Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rickclephas/kotlin-docc
Generate Swift DocC documentation for your Kotlin Multiplatform frameworks
https://github.com/rickclephas/kotlin-docc
api-reference documentation kotlin swift
Last synced: 2 months ago
JSON representation
Generate Swift DocC documentation for your Kotlin Multiplatform frameworks
- Host: GitHub
- URL: https://github.com/rickclephas/kotlin-docc
- Owner: rickclephas
- License: mit
- Created: 2023-10-11T18:48:28.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-18T15:23:23.000Z (over 1 year ago)
- Last Synced: 2023-10-18T16:35:05.004Z (over 1 year ago)
- Topics: api-reference, documentation, kotlin, swift
- Language: Kotlin
- Homepage:
- Size: 84 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kotlin-DocC
Kotlin-DocC is a Gradle plugin that integrates the [`docc`](https://github.com/apple/swift-docc)
CLI into your Kotlin Multiplatform projects.Generating your first `.doccarchive` is as easy as applying the plugin:
```kotlin
plugins {
id("com.rickclephas.kmp.docc") version "0.1.0"
}
```and running the `doccConvert` or `doccPreview` task for your target's framework.
Both the `doccConvert` and `doccPreview` tasks can be configured with the `docC` extension:
```kotlin
import com.rickclephas.kmp.docc.dsl.docCgroup = "com.example"
version = "1.0"kotlin {
macosArm64 {
binaries.framework {
baseName = "MyFramework"
docC {
// Configure the doccConvert and doccPreview tasks
common {
// Configure the fallback values for the documentation bundle's Info.plist properties
displayName.set("MyFramework")
bundleIdentifier.set("com.example.MyFramework")
bundleVersion.set("1.0")// Use a custom Swift-DocC-Render template,
// by default the Kotlin-DocC-Render template is used.
// Setting this to `null` wil use the built-in Xcode template.
renderDir.set(null as Directory?)
// Adds additional arguments to the docc command
additionalArgs.add("--warnings-as-errors")
}
// Configure the doccConvert task
convert {
// Indicates if the `process-archive index` command should be run
createIndex.set(false)
}
// Configure the doccPreview task
preview {
// The port number to use for the preview web server
port.set(8080)
}
}
}
}
}
```To further customize your documentation you can generate a `.docc` documentation bundle by adding files to
`src/commonMain/docc`, or the `docc` folder of other source-sets.Take a look at the official DocC [documentation](https://www.swift.org/documentation/docc) to learn more about
[formatting your documentation content](https://www.swift.org/documentation/docc/formatting-your-documentation-content)
and [adding structure to your documentation pages](https://www.swift.org/documentation/docc/adding-structure-to-your-documentation-pages).