Skip to content

Commit

Permalink
Documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankoppier committed Jul 1, 2024
1 parent 5f253a1 commit e67bb96
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 14 deletions.
5 changes: 5 additions & 0 deletions website/src/_data/navigation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"header": [
{
"caption": "Home",
"url": "/",
"external": false
},
{
"caption": "Changelog",
"url": "/changelog/",
Expand Down
10 changes: 7 additions & 3 deletions website/src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,15 @@ figure figcaption {
min-inline-size: var(--inline-size);
}

.table {
table {
--spruce-line-height: 1.5;
--spruce-padding: 1rem;
--spruce-responsive-inline-size: 40rem;
border-collapse: collapse;
color: var(--spruce-table-color-text);
inline-size: 100%;
inline-size: 80%;
margin-left: auto;
margin-right: auto;
}
.table caption {
color: var(--spruce-table-color-caption);
Expand All @@ -609,8 +611,9 @@ figure figcaption {
}
.table th {
color: var(--spruce-table-color-heading);
text-align: inherit;
text-align: left;
text-align: -webkit-match-parent;
padding: var(--spruce-padding);
}
.table--striped > tbody > tr:nth-child(odd) {
background-color: var(--spruce-table-color-stripe);
Expand Down Expand Up @@ -2208,3 +2211,4 @@ textarea.pagefind-ui__search-input {
--spruce-max-content-inline-size: 70rem;
--spruce-box-shadow: 0 0.75rem 1.25rem hsla(0, 0%, 0%, 0.05);
}

2 changes: 1 addition & 1 deletion website/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ btns:
caption: "Changelog"
url: "/changelog/"
type: "outline"
summary: "Mappie is a Kotlin compiler plugin generating performant object mapping code at compile-time while writing minimal code."
summary: "Mappie is a Kotlin compiler plugin generating performant object mapping code at compile-time while minimizing development effort."
displaySummary: true
layout: "layouts/front-page.html"
overview:
Expand Down
5 changes: 3 additions & 2 deletions website/src/posts/enum-mapping/posts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ configuration to the `build.gradle.kts` file
```kotlin
mappie {
strictness {
enums = false // Disable validating that all enum sources have a corresponding target
enums = true // Do not report an error if not all enum sources are mapped
}
}
```

Note that this might result in a [NoWhenBranchMatchedException](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-no-when-branch-matched-exception/) exception being thrown at runtime.
Note that this might result in a [NoWhenBranchMatchedException](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-no-when-branch-matched-exception/)
being thrown at runtime.
15 changes: 11 additions & 4 deletions website/src/posts/getting-started/posts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ eleventyNavigation:
Mappie can be configured via Gradle. The following global configuration options are available
```kotlin
mappie {
warningsAsErrors = true // Enable reporting warnings as erros
warningsAsErrors = true // Enable reporting warnings as errors
strictness {
visibility = false // Disable only selecting visible constructors
enums = false // Disable validating that all enum sources have a corresponding target
visibility = true // Allow calling constructors not visible from the calling scope
enums = true // Do not report an error if not all enum sources are mapped
}
}
```
```
with the following default values

| Option | Default Value |
|-------------------------|----------------|
| `warningsAsErrors` | `false` |
| `strictness.visibility` | `false` |
| `strictness.enums` | `false` |
4 changes: 2 additions & 2 deletions website/src/posts/getting-started/posts/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ eleventyNavigation:
order: 2
---

Mappie is a Kotlin compiler plugin. The most convenient way to use compiler plugins is
to apply the Gradle plugin which in term applies the compiler plugin to the Kotlin compilation.
Mappie is a Kotlin compiler plugin. The preferred way to use Mappie is to apply the Gradle plugin which in term
applies the compiler plugin to the Kotlin compilation.

This can be achieved by adding the following snippet to the `build.gradle.kts` file.
```kotlin
Expand Down
2 changes: 1 addition & 1 deletion website/src/posts/object-mapping/posts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This can be disabled by adding the following configuration to the `build.gradle.
```kotlin
mappie {
strictness {
visibility = false // Disable only selecting visible constructors
visibility = true // Allow calling constructors not visible from the calling scope
}
}
```
2 changes: 1 addition & 1 deletion website/src/posts/object-mapping/posts/resolving.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object PersonMapper : ObjectMappie<Person, PersonDto>() {
}
}
```
will always set `PersonDto.description` to `"unknown`.
will always set `PersonDto.description` to `"unknown"`.

## Mapping via an Expression
Targets can be set via the operator `fromExpression`. This will set the target to the given lambda result.
Expand Down

0 comments on commit e67bb96

Please sign in to comment.