A collection of misc. plugins for dokka that add a few useful things.
Include custom .js
scripts, similar to how it is done with css styles and images.
To use this plugin, add the following to your buildscript:
dependencies {
dokkaPlugin("ca.solo-studios:dokka-script-plugin:[VERSION]")
}
The plugin is used as follows:
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaScriptsPlugin, DokkaScriptsConfiguration> {
scripts = listOf(file("somescript.js")) // List<File>
remoteScripts = listOf("https://example.com/somescript.js") // List<String>
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"scripts": ["somescript.js"],
"remoteScripts": ["https://example.com/somescript.js"]
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
The scripts are included on every single page.
Applies custom style tweaks to dokka to make it look better. All tweaks are opt-in, so by default the plugin applies no changes.
To use this plugin, add the following to your buildscript:
dependencies {
dokkaPlugin("ca.solo-studios:dokka-style-tweaks-plugin:[VERSION]")
}
- Minimal scrollbar
- Dark mode purple highlight
- Fix color-scheme in dark theme
- Improved block quotes
- Improved block quote border
- Distinguished block quote text
- Improved section tab (eg. the "Members" tab)
- Improved section tab border
- Set section tab font weight
- Add transition for section tab
- Disable code wrapping
- Custom sidebar width
Expand
Makes the scrollbar style more minimalist, as well as making the scrollbar look better in dark mode.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
minimalScrollbar = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"minimalScrollbar": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Off:
Browser | Light Mode | Dark Mode |
---|---|---|
Chrome | ||
Firefox |
On:
Browser | Light Mode | Dark Mode |
---|---|---|
Chrome | ||
Firefox |
Expand
Highlights the selected sidebar item in purple when in dark mode, for parity with light mode.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
darkPurpleHighlight = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"darkPurpleHighlight": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Off:
On:
Expand
Sets color-scheme
to dark
when the dark mode is enabled.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
darkColorSchemeFix = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"darkColorSchemeFix": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Expand
Improves the border of block quotes.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
improvedBlockquoteBorder = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"improvedBlockquoteBorder": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Off:
On:
Expand
Makes the block quote text visually different from the rest of the text.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
lighterBlockquoteText = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"lighterBlockquoteText": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Off:
On:
Expand
Improves the border of section tabs.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
improvedSectionTabBorder = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"improvedSectionTabBorder": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Off:
On:
Expand
Changes the font weight of the section tab.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
sectionTabFontWeight = "500"
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"sectionTabFontWeight": "500"
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Note: it will look different depending on the font weight you select.
Off:
On:
Expand
Transition for when hovering over/selecting section tabs.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
sectionTabTransition = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"sectionTabTransition": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Expand
Disables wrapping of code blocks if the line is too long.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
disableCodeWrapping = true
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"disableCodeWrapping": true
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}
Note: A scrollbar is shown on hover.
Off:
On:
Expand
Sets a custom width for the sidebar.
tasks {
withType<AbstractDokkaTask>().configureEach {
// type-safe plugin configuration
pluginConfiguration<DokkaStyleTweaksPlugin, DokkaStyleTweaksConfiguration> {
sidebarWidth = "500px"
}
// json plugin configuration
val dokkaTweaksConfiguration = """
{
"sidebarWidth": "500px"
}
"""
pluginConfiguration.set(
mapOf(
"ca.solostudios.dokkastyles.plugin.DokkaStyleTweaksPlugin" to dokkaTweaksConfiguration,
)
)
}
}