From e67bb96cd6f2ff2b9c1e0634f4520effd3bf7685 Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Mon, 1 Jul 2024 17:37:57 +0200 Subject: [PATCH] Documentation improvements --- website/src/_data/navigation.json | 5 +++++ website/src/css/main.css | 10 +++++++--- website/src/index.md | 2 +- .../src/posts/enum-mapping/posts/configuration.md | 5 +++-- .../posts/getting-started/posts/configuration.md | 15 +++++++++++---- .../posts/getting-started/posts/installation.md | 4 ++-- .../posts/object-mapping/posts/configuration.md | 2 +- .../src/posts/object-mapping/posts/resolving.md | 2 +- 8 files changed, 31 insertions(+), 14 deletions(-) diff --git a/website/src/_data/navigation.json b/website/src/_data/navigation.json index 5a74eadc..a37d08e9 100644 --- a/website/src/_data/navigation.json +++ b/website/src/_data/navigation.json @@ -1,5 +1,10 @@ { "header": [ + { + "caption": "Home", + "url": "/", + "external": false + }, { "caption": "Changelog", "url": "/changelog/", diff --git a/website/src/css/main.css b/website/src/css/main.css index 385a4f56..9a45ec38 100644 --- a/website/src/css/main.css +++ b/website/src/css/main.css @@ -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); @@ -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); @@ -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); } + diff --git a/website/src/index.md b/website/src/index.md index 15bdbf89..35b623bb 100644 --- a/website/src/index.md +++ b/website/src/index.md @@ -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: diff --git a/website/src/posts/enum-mapping/posts/configuration.md b/website/src/posts/enum-mapping/posts/configuration.md index ffa7cda2..1aa90e42 100644 --- a/website/src/posts/enum-mapping/posts/configuration.md +++ b/website/src/posts/enum-mapping/posts/configuration.md @@ -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. \ No newline at end of file +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. \ No newline at end of file diff --git a/website/src/posts/getting-started/posts/configuration.md b/website/src/posts/getting-started/posts/configuration.md index 525afede..6e67427f 100644 --- a/website/src/posts/getting-started/posts/configuration.md +++ b/website/src/posts/getting-started/posts/configuration.md @@ -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 } } -``` \ No newline at end of file +``` +with the following default values + +| Option | Default Value | +|-------------------------|----------------| +| `warningsAsErrors` | `false` | +| `strictness.visibility` | `false` | +| `strictness.enums` | `false` | diff --git a/website/src/posts/getting-started/posts/installation.md b/website/src/posts/getting-started/posts/installation.md index 4752c6c6..0a77c97c 100644 --- a/website/src/posts/getting-started/posts/installation.md +++ b/website/src/posts/getting-started/posts/installation.md @@ -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 diff --git a/website/src/posts/object-mapping/posts/configuration.md b/website/src/posts/object-mapping/posts/configuration.md index 3e61ce10..7219f2da 100644 --- a/website/src/posts/object-mapping/posts/configuration.md +++ b/website/src/posts/object-mapping/posts/configuration.md @@ -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 } } ``` \ No newline at end of file diff --git a/website/src/posts/object-mapping/posts/resolving.md b/website/src/posts/object-mapping/posts/resolving.md index ec3c19a1..becfab61 100644 --- a/website/src/posts/object-mapping/posts/resolving.md +++ b/website/src/posts/object-mapping/posts/resolving.md @@ -62,7 +62,7 @@ object PersonMapper : ObjectMappie() { } } ``` -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.