Skip to content

Commit e5006d6

Browse files
committed
Make fromJson(JsonObject) API consistently public
Refresh documentation site Use Dokka HTML templates Release 0.2.1
1 parent 705d1aa commit e5006d6

File tree

10 files changed

+71
-16
lines changed

10 files changed

+71
-16
lines changed

.github/workflows/publish-website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
python-version: 3.8
1818

1919
- name: Build Dokka docs
20-
run: ./gradlew dokkaGfmMultiModule --no-daemon --no-parallel
20+
run: ./gradlew dokkaHtmlMultiModule --no-daemon --no-parallel
2121

2222
- name: Build mkdocs
2323
run: |

build.gradle.kts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ tasks.withType<Detekt> {
3737
}
3838
}
3939

40-
tasks.dokkaGfmMultiModule.configure {
40+
tasks.dokkaHtmlMultiModule.configure {
4141
outputDirectory.set(rootDir.absoluteFile.resolve("docs/api"))
42+
moduleName.set("Spatial K")
43+
44+
pluginsMapConfiguration.set(
45+
mapOf(
46+
"org.jetbrains.dokka.base.DokkaBase" to """
47+
{
48+
"footerMessage": "Copyright &copy; 2022 Derek Ellis",
49+
"customStyleSheets": ["${file("docs/css/logo-styles.css").invariantSeparatorsPath}"]
50+
}
51+
""".trimIndent()
52+
)
53+
)
4254
}

docs/css/logo-styles.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:root {
2+
--color-dark: #4cae4f;
3+
}
4+
5+
:root.theme-dark {
6+
--color-dark: #4cae4f;
7+
}
8+
9+
10+
.library-name a {
11+
position: relative;
12+
margin-left: 55px;
13+
}
14+
15+
.library-name a::before {
16+
content: '';
17+
background: url("../../images/logo.png") center no-repeat;
18+
background-size: contain;
19+
position: absolute;
20+
width: 50px;
21+
height: 50px;
22+
top: -18px;
23+
left: -55px;
24+
}

geojson/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.net.URL
2+
13
plugins {
24
alias(libs.plugins.kotlin.multiplatform)
35
alias(libs.plugins.kotlin.serialization)

geojson/src/commonMain/kotlin/io/github/dellisd/spatialk/geojson/MultiPolygon.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class MultiPolygon @JvmOverloads constructor(
6868
}
6969

7070
@JvmStatic
71-
internal fun fromJson(json: JsonObject): MultiPolygon {
71+
public fun fromJson(json: JsonObject): MultiPolygon {
7272
if (json.getValue("type").jsonPrimitive.content != "MultiPolygon") {
7373
throw IllegalArgumentException("Object \"type\" is not \"MultiPolygon\".")
7474
}

geojson/src/commonMain/kotlin/io/github/dellisd/spatialk/geojson/Point.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Point @JvmOverloads constructor(val coordinates: Position, override val bb
5050
}
5151

5252
@JvmStatic
53-
internal fun fromJson(json: JsonObject): Point {
53+
public fun fromJson(json: JsonObject): Point {
5454
if (json.getValue("type").jsonPrimitive.content != "Point") {
5555
throw IllegalArgumentException("Object \"type\" is not \"Point\".")
5656
}

geojson/src/commonMain/kotlin/io/github/dellisd/spatialk/geojson/Polygon.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Polygon @JvmOverloads constructor(
6363
}
6464

6565
@JvmStatic
66-
internal fun fromJson(json: JsonObject): Polygon {
66+
public fun fromJson(json: JsonObject): Polygon {
6767
if (json.getValue("type").jsonPrimitive.content != "Polygon") {
6868
throw IllegalArgumentException("Object \"type\" is not \"Polygon\".")
6969
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kotlin.code.style=official
22

33
GROUP=io.github.dellisd.spatialk
4-
VERSION_NAME=0.2.1-SNAPSHOT
4+
VERSION_NAME=0.2.1
55

66
POM_URL=https://github.com/dellisd/spatial-k
77
POM_SCM_URL=https://github.com/dellisd/spatial-k

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
1515
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "benchmark" }
1616
publish = { id = "com.vanniktech.maven.publish", version = "0.19.0" }
1717
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.20.0" }
18-
dokka = { id = "org.jetbrains.dokka", version = "1.4.32" }
18+
dokka = { id = "org.jetbrains.dokka", version = "1.6.20" }
1919
resources = { id = "com.goncalossilva.resources", version.ref = "resources" }

mkdocs.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repo_name: "spatial-k"
44
repo_url: https://github.com/dellisd/spatial-k
55
site_description: "Kotlin Multiplatform GeoJson library and Turfjs port"
66
site_author: Derek Ellis
7-
copyright: 'Copyright &copy; 2021 Derek Ellis'
7+
copyright: 'Copyright &copy; 2022 Derek Ellis'
88
remote_branch: gh-pages
99

1010
nav:
@@ -14,20 +14,36 @@ nav:
1414
- 'Overview': turf.md
1515
- 'Ported Functions': ported-functions.md
1616
- 'API':
17-
- 'geojson': api/geojson/index.md
18-
- 'turf': api/turf/index.md
17+
- 'index': api/index.html
18+
- 'geojson': api/geojson/index.html
19+
- 'turf': api/turf/index.html
1920

2021
theme:
2122
name: 'material'
2223
favicon: images/logo.png
2324
logo: images/logo.png
25+
features:
26+
- navigation.indexes
2427
palette:
25-
primary: 'green'
26-
accent: 'blue'
28+
- media: "(prefers-color-scheme: light)"
29+
scheme: default
30+
toggle:
31+
icon: material/weather-sunny
32+
name: Switch to dark mode
33+
primary: 'green'
34+
accent: 'blue'
35+
- media: "(prefers-color-scheme: dark)"
36+
scheme: slate
37+
toggle:
38+
icon: material/weather-night
39+
name: Switch to light mode
40+
primary: 'green'
41+
accent: 'blue'
2742

2843
markdown_extensions:
29-
- codehilite:
30-
guess_lang: false
44+
- pymdownx.highlight:
45+
anchor_linenums: true
46+
- pymdownx.snippets
3147
- pymdownx.arithmatex
3248
- pymdownx.betterem:
3349
smart_enable: all
@@ -44,5 +60,6 @@ markdown_extensions:
4460
- pymdownx.superfences
4561
- pymdownx.tasklist:
4662
custom_checkbox: true
47-
- pymdownx.tabbed
48-
- pymdownx.tilde
63+
- pymdownx.tabbed:
64+
alternate_style: true
65+
- pymdownx.tilde

0 commit comments

Comments
 (0)