Skip to content

Commit 95eb680

Browse files
authored
Kotlin examples (#4)
1 parent 7b7603f commit 95eb680

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

README.md

+25-3
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,30 @@ Highlighted features:
1212

1313
The wiki toolkit plugin is available on the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/org.moddedmc.wiki.toolkit).
1414

15-
You can install it in your project by adding the following code to your `build.gradle`.
15+
You can install it in your project by adding the following code to your `build.gradle` or `build.gradle.kts`.
1616

17+
`build.gradle`
1718
```groovy
1819
plugins {
1920
id 'org.moddedmc.wiki.toolkit' version '<version>'
2021
}
2122
```
2223

24+
`build.gradle.kts`
25+
```kts
26+
plugins {
27+
id("org.moddedmc.wiki.toolkit") version "<version>"
28+
}
29+
```
30+
31+
2332
## Setup
2433

2534
The initial step for using this plugin is registering documentation roots, which is done via a Gradle DSL.
2635

2736
A minimal setup may look like this:
2837

38+
`build.gradle`
2939
```groovy
3040
wiki {
3141
docs {
@@ -38,6 +48,17 @@ wiki {
3848
}
3949
```
4050

51+
`build.gradle.kts`
52+
```kts
53+
wiki {
54+
// The name of the object (examplemod) should match the registered wiki project ID (if it exists).
55+
docs.create("examplemod") {
56+
// The path to the folder containing the documentation metadata file (sinytra-wiki.json)
57+
root = file("docs/examplemod")
58+
}
59+
}
60+
```
61+
4162
## Real-time documentation preview
4263

4364
The plugin allows you to preview your mod documentation in real-time on your local machine. Behind the scenes,
@@ -89,7 +110,8 @@ There's no need to worry about it being present in all game runs, as it does not
89110
nor does it affect the game. The exporter code only activates on designated run configurations.
90111

91112
```groovy
92-
// Adding a repository is not necessary; it is automatically installed by the plugin
113+
// Adding a repository is not necessary; it is automatically installed by the plugin.
114+
// However, if you are using a multiloader setup like Architectury Loom, you will need to install the plugin on your subprojects as well.
93115
dependencies {
94116
// ModDevGradle
95117
// Version list: https://maven.sinytra.org/org/sinytra/item-asset-export-neoforge
@@ -131,7 +153,7 @@ Once the token is generated, add it to your gradle configuration under the `wiki
131153

132154
```groovy
133155
wiki {
134-
wikiAccessToken = 'MY_ACCESS_TOKEN' // Starts with github_pat_
156+
wikiAccessToken = "MY_ACCESS_TOKEN" // Starts with github_pat_
135157
}
136158
```
137159

0 commit comments

Comments
 (0)