Skip to content

Commit

Permalink
Make fromJson(JsonObject) API consistently public
Browse files Browse the repository at this point in the history
Refresh documentation site
Use Dokka HTML templates
Release 0.2.1
  • Loading branch information
dellisd committed Apr 16, 2022
1 parent 705d1aa commit e5006d6
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
python-version: 3.8

- name: Build Dokka docs
run: ./gradlew dokkaGfmMultiModule --no-daemon --no-parallel
run: ./gradlew dokkaHtmlMultiModule --no-daemon --no-parallel

- name: Build mkdocs
run: |
Expand Down
14 changes: 13 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ tasks.withType<Detekt> {
}
}

tasks.dokkaGfmMultiModule.configure {
tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(rootDir.absoluteFile.resolve("docs/api"))
moduleName.set("Spatial K")

pluginsMapConfiguration.set(
mapOf(
"org.jetbrains.dokka.base.DokkaBase" to """
{
"footerMessage": "Copyright &copy; 2022 Derek Ellis",
"customStyleSheets": ["${file("docs/css/logo-styles.css").invariantSeparatorsPath}"]
}
""".trimIndent()
)
)
}
24 changes: 24 additions & 0 deletions docs/css/logo-styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
:root {
--color-dark: #4cae4f;
}

:root.theme-dark {
--color-dark: #4cae4f;
}


.library-name a {
position: relative;
margin-left: 55px;
}

.library-name a::before {
content: '';
background: url("../../images/logo.png") center no-repeat;
background-size: contain;
position: absolute;
width: 50px;
height: 50px;
top: -18px;
left: -55px;
}
2 changes: 2 additions & 0 deletions geojson/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.net.URL

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class MultiPolygon @JvmOverloads constructor(
}

@JvmStatic
internal fun fromJson(json: JsonObject): MultiPolygon {
public fun fromJson(json: JsonObject): MultiPolygon {
if (json.getValue("type").jsonPrimitive.content != "MultiPolygon") {
throw IllegalArgumentException("Object \"type\" is not \"MultiPolygon\".")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Point @JvmOverloads constructor(val coordinates: Position, override val bb
}

@JvmStatic
internal fun fromJson(json: JsonObject): Point {
public fun fromJson(json: JsonObject): Point {
if (json.getValue("type").jsonPrimitive.content != "Point") {
throw IllegalArgumentException("Object \"type\" is not \"Point\".")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Polygon @JvmOverloads constructor(
}

@JvmStatic
internal fun fromJson(json: JsonObject): Polygon {
public fun fromJson(json: JsonObject): Polygon {
if (json.getValue("type").jsonPrimitive.content != "Polygon") {
throw IllegalArgumentException("Object \"type\" is not \"Polygon\".")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kotlin.code.style=official

GROUP=io.github.dellisd.spatialk
VERSION_NAME=0.2.1-SNAPSHOT
VERSION_NAME=0.2.1

POM_URL=https://github.com/dellisd/spatial-k
POM_SCM_URL=https://github.com/dellisd/spatial-k
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "benchmark" }
publish = { id = "com.vanniktech.maven.publish", version = "0.19.0" }
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.20.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.4.32" }
dokka = { id = "org.jetbrains.dokka", version = "1.6.20" }
resources = { id = "com.goncalossilva.resources", version.ref = "resources" }
35 changes: 26 additions & 9 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repo_name: "spatial-k"
repo_url: https://github.com/dellisd/spatial-k
site_description: "Kotlin Multiplatform GeoJson library and Turfjs port"
site_author: Derek Ellis
copyright: 'Copyright &copy; 2021 Derek Ellis'
copyright: 'Copyright &copy; 2022 Derek Ellis'
remote_branch: gh-pages

nav:
Expand All @@ -14,20 +14,36 @@ nav:
- 'Overview': turf.md
- 'Ported Functions': ported-functions.md
- 'API':
- 'geojson': api/geojson/index.md
- 'turf': api/turf/index.md
- 'index': api/index.html
- 'geojson': api/geojson/index.html
- 'turf': api/turf/index.html

theme:
name: 'material'
favicon: images/logo.png
logo: images/logo.png
features:
- navigation.indexes
palette:
primary: 'green'
accent: 'blue'
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/weather-sunny
name: Switch to dark mode
primary: 'green'
accent: 'blue'
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-night
name: Switch to light mode
primary: 'green'
accent: 'blue'

markdown_extensions:
- codehilite:
guess_lang: false
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.snippets
- pymdownx.arithmatex
- pymdownx.betterem:
smart_enable: all
Expand All @@ -44,5 +60,6 @@ markdown_extensions:
- pymdownx.superfences
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tabbed
- pymdownx.tilde
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tilde

0 comments on commit e5006d6

Please sign in to comment.