-
Notifications
You must be signed in to change notification settings - Fork 41
Use mkdocs-material for documentation
#178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SMILEY4
merged 7 commits into
SMILEY4:pre-release-5-0-0
from
king-phyte:pre-release-5-0-0
Feb 3, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1057f0d
docs: update comments and writing style
king-phyte 6778991
docs: add documentation pages and `mkdocs-material`
king-phyte e009eb7
chore: update .gitignore to account for OS and Python
king-phyte 1191403
docs: autogenerate API reference with dokka
king-phyte 214d590
docs: use `gradle-mkdocs-plugin`
king-phyte 3bc2add
Merge branch 'pre-release-5-0-0' into pre-release-5-0-0
king-phyte f495bc6
Merge branch 'pre-release-5-0-0' into pre-release-5-0-0
SMILEY4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,134 @@ | ||
| .idea | ||
| .gradle | ||
| # Jetbrains | ||
| .idea/ | ||
|
|
||
| ### Kotlin | ||
| .kotlin | ||
| build | ||
| *.class | ||
| *.log | ||
| *.jar | ||
|
|
||
| # Dokka | ||
| docs/dokka/ | ||
|
|
||
| ### Visual Studio Code | ||
| .vscode/ | ||
|
|
||
| # Local History for Visual Studio Code | ||
| .history/ | ||
|
|
||
| ### Linux | ||
| *~ | ||
|
|
||
| # temporary files which can be created if a process still has a handle open of a deleted file | ||
| .fuse_hidden* | ||
|
|
||
| # KDE directory preferences | ||
| .directory | ||
|
|
||
| # Linux trash folder which might appear on any partition or disk | ||
| .Trash-* | ||
|
|
||
| # .nfs files are created when an open file is removed but is still being accessed | ||
| .nfs* | ||
|
|
||
| ### Windows | ||
| # Windows thumbnail cache files | ||
| Thumbs.db | ||
| Thumbs.db:encryptable | ||
| ehthumbs.db | ||
| ehthumbs_vista.db | ||
|
|
||
| # Dump file | ||
| *.stackdump | ||
|
|
||
| # Folder config file | ||
| [Dd]esktop.ini | ||
|
|
||
| # Recycle Bin used on file shares | ||
| $RECYCLE.BIN/ | ||
|
|
||
| # Windows Installer files | ||
| *.cab | ||
| *.msi | ||
| *.msix | ||
| *.msm | ||
| *.msp | ||
|
|
||
| # Windows shortcuts | ||
| *.lnk | ||
|
|
||
| ### Gradle | ||
| .gradle/ | ||
| build/ | ||
|
|
||
| # Ignore Gradle GUI config | ||
| gradle-app.setting | ||
|
|
||
| # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
| !gradle-wrapper.jar | ||
|
|
||
| # Avoid ignore Gradle wrappper properties | ||
| !gradle-wrapper.properties | ||
|
|
||
| # Cache of project | ||
| .gradletasknamecache | ||
|
|
||
| # Eclipse Gradle plugin generated files | ||
| # Eclipse Core | ||
| .project | ||
| # JDT-specific (Eclipse Java Development Tools) | ||
| .classpath | ||
|
|
||
| ### macOS | ||
| # General | ||
| .DS_Store | ||
| .AppleDouble | ||
| .LSOverride | ||
|
|
||
| # Icon must end with two \r | ||
| Icon | ||
|
|
||
| # Thumbnails | ||
| ._* | ||
|
|
||
| # Files that might appear in the root of a volume | ||
| .DocumentRevisions-V100 | ||
| .fseventsd | ||
| .Spotlight-V100 | ||
| .TemporaryItems | ||
| .Trashes | ||
| .VolumeIcon.icns | ||
| .com.apple.timemachine.donotpresent | ||
|
|
||
| # Directories potentially created on remote AFP share | ||
| .AppleDB | ||
| .AppleDesktop | ||
| Network Trash Folder | ||
| Temporary Items | ||
| .apdisk | ||
|
|
||
|
|
||
| ### Python | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
|
|
||
| # pyenv | ||
| .python-version | ||
|
|
||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
|
|
||
| # mkdocs documentation | ||
| /site |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Changelog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Authentication | ||
|
|
||
|
|
||
| ```kotlin title="Authentication.kt" linenums="1" | ||
| ---8<--- "Authentication.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| [//]: # (# Basics) | ||
|
|
||
| [//]: # () | ||
| [//]: # (This example shows a basic usage of the plugin) | ||
|
|
||
| [//]: # () | ||
| [//]: # (## Complete Example) | ||
|
|
||
| [//]: # (```kotlin title="Basics.kt" linenums="1") | ||
|
|
||
| [//]: # (--8<-- "Basics.kt") | ||
|
|
||
| [//]: # (```) | ||
|
|
||
| [//]: # () | ||
| [//]: # (## Breaking it down) | ||
|
|
||
| [//]: # (### Install and configure the plugin) | ||
|
|
||
| [//]: # () | ||
| [//]: # (```kotlin title="Basics.kt") | ||
|
|
||
| [//]: # (--8<-- "Basics.kt:24:44") | ||
|
|
||
| [//]: # (```) | ||
|
|
||
| [//]: # () | ||
| [//]: # (### Configure routes) | ||
|
|
||
| [//]: # () | ||
| [//]: # (#### Spec routes) | ||
|
|
||
| [//]: # () | ||
| [//]: # (=== "OpenAPI") | ||
|
|
||
| [//]: # () | ||
| [//]: # ( Configure the OpenAPI spec file to be served from `/api.json`) | ||
|
|
||
| [//]: # ( ) | ||
| [//]: # ( ```kotlin) | ||
|
|
||
| [//]: # ( --8<-- "Basics.kt:50:52") | ||
|
|
||
| [//]: # ( ```) | ||
|
|
||
| [//]: # () | ||
| [//]: # (=== "Swagger UI") | ||
|
|
||
| [//]: # () | ||
| [//]: # ( Configure Swagger UI to be served from `/swagger` with the OpenAPI spec file at `/api.json`) | ||
|
|
||
| [//]: # () | ||
| [//]: # ( ```kotlin) | ||
|
|
||
| [//]: # ( --8<-- "Basics.kt:55:57") | ||
|
|
||
| [//]: # ( ```) | ||
|
|
||
| [//]: # () | ||
| [//]: # (=== "ReDoc") | ||
|
|
||
| [//]: # () | ||
| [//]: # ( Configure Swagger UI to be served from `/redoc` with the OpenAPI spec file at `/api.json`) | ||
|
|
||
| [//]: # () | ||
| [//]: # ( ```kotlin) | ||
|
|
||
| [//]: # ( --8<-- "Basics.kt:55:57") | ||
|
|
||
| [//]: # ( ```) | ||
|
|
||
| [//]: # () | ||
| [//]: # (!!! note) | ||
|
|
||
| [//]: # () | ||
| [//]: # ( The spec routes will not be included in the final OpenAPI spec file) | ||
|
|
||
| [//]: # () | ||
| [//]: # () | ||
| [//]: # (#### Document a route) | ||
|
|
||
| [//]: # () | ||
| [//]: # (We add information about the route itself) | ||
|
|
||
| [//]: # () | ||
| [//]: # (```kotlin title="Basics.kt" hl_lines="3") | ||
|
|
||
| [//]: # (--8<-- "Basics.kt:65:86") | ||
|
|
||
| [//]: # (```) | ||
|
|
||
| [//]: # () | ||
| [//]: # (We add information about the request) | ||
|
|
||
| [//]: # () | ||
| [//]: # (```kotlin title="Basics.kt" hl_lines="5-10") | ||
|
|
||
| [//]: # (--8<-- "Basics.kt:65:86") | ||
|
|
||
| [//]: # (```) | ||
|
|
||
| [//]: # () | ||
| [//]: # (And finally, the response) | ||
|
|
||
| [//]: # () | ||
| [//]: # (```kotlin title="Basics.kt" hl_lines="12-15") | ||
|
|
||
| [//]: # (--8<-- "Basics.kt:65:86") | ||
|
|
||
| [//]: # (```) | ||
|
|
||
| # Basic | ||
|
|
||
| This example shows a basic usage of the plugin | ||
|
|
||
| ```kotlin title="Basics.kt" linenums="1" | ||
| --8<---- "Basics.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Complete Configuration | ||
|
|
||
| This example showcases a **nearly** complete - and mostly nonsensical - plugin configuration | ||
|
|
||
| ```kotlin title="CompleteConfig.kt" linenums="1" | ||
| --8<-- "CompleteConfig.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Customized Schema Generator | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "CustomizedSchemaGenerator.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # External OpenAPI Spec | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "ExternalOpenApiSpec.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # File Upload | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "FileUpload.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Kotlinx Serialization | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "KotlinxSerialization.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Minimal | ||
|
|
||
| This example showcases using the plugin with most of the default configuration | ||
|
|
||
| ```kotlin title="Minimal.kt" linenums="1" | ||
| --8<-- "Minimal.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Multiple Specs | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "MultipleSpecs.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # OpenAPI Examples | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "Examples.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Petstore | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "Petstore.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Requests and Responses | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "RequestResponse.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Schemas | ||
|
|
||
| ```kotlin linenums="1" | ||
| ---8<--- "Schemas.kt" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Ktor Swagger UI | ||
|
|
||
| [](https://search.maven.org/artifact/io.github.smiley4/ktor-swagger-ui) | ||
| [](https://github.com/SMILEY4/ktor-swagger-ui/actions/workflows/checks.yml) | ||
|
|
||
| This library provides a [Ktor](https://ktor.io/) plugin to document routes, generate an OpenAPI specification and serve [Swagger UI](https://swagger.io/tools/swagger-ui/) and [ReDoc](https://github.com/Redocly/redoc). | ||
|
|
||
| It is meant to be minimally invasive i.e. it can be plugged into existing application without requiring immediate changes to the code. | ||
| Routes can then be gradually enhanced with documentation. | ||
|
|
||
|
|
||
| ## Features | ||
|
|
||
| - Minimally invasive (no immediate change to existing code required) | ||
| - Provides OpenAPI spec, Swagger UI and ReDoc with minimal configuration | ||
| - Supports most of the [OpenAPI 3.1.0 Specification](https://swagger.io/specification/) | ||
| - Automatic [json-schema generation](https://github.com/SMILEY4/schema-kenerator) from arbitrary types/classes for bodies and parameters | ||
| - Supports generics, inheritance, collections, etc. | ||
| - (Optional) support for Jackson-annotations and swagger schema annotations | ||
| - Use with reflection or kotlinx-serialization | ||
| - Customizable schema generation | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maye remove badges from mkdocs wiki -> I think one of them results in some cookies associated with google analytics being set. I'm not 100% sure though about it, perhaps you could test it too and double check.
Firefox blocks it for me, though google chrome seems to allow it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into it. It seems to be the
Checks - Passingbadge.But that also reminds me, now that we have three packages instead of one, we may need to add the others to
Maven Centralif we still want to keep that too.