Skip to content

Commit 28ac89e

Browse files
authored
Merge pull request #302 from modelix/fix/modelql-docs
MODELIX-591: Add modeQL doc tree and generate latest API symlink
2 parents 7fd663d + a29d18b commit 28ac89e

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
path: build/dokka
2525
- name: Generate Docs with Dokka
2626
run: ./gradlew dokkaHtmlMultiModule
27+
- name: Create symlink to latest version
28+
run: |
29+
cd build/dokka
30+
latestVersion=$(for n in *; do printf '%s\n' "$n"; done | sort -V | grep -E "^[0-9]+\.[0-9]+" | tail -n1)
31+
if [[ -z "${latestVersion}" ]]; then
32+
ln -sf ${latestVersion} latest
33+
fi
2734
- name: Publish to GitHub Pages
2835
uses: peaceiris/actions-gh-pages@v3
2936
with:

build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,17 @@ fun createDocsIndexPage(): String {
329329
?.filter { it.isDirectory && !it.name.startsWith('.') }
330330
?.sortedByDescending { Version.parse(it.name) }
331331
if (versionDirs != null) {
332+
div("table-row") {
333+
div("main-subrow") {
334+
div("w-100") {
335+
span("inline-flex") {
336+
a(href = "/latest") {
337+
+"modelix.core LATEST"
338+
}
339+
}
340+
}
341+
}
342+
}
332343
for (versionDir in versionDirs) {
333344
val versionIndex = versionDir.resolve("index.html")
334345
if (versionIndex.exists()) {

docs/global/modules/core/partials/nav-howto.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
* xref:core:howto/usage-model-api-gen-gradle.adoc[]
33
* xref:core:howto/usage-light-model-client.adoc[]
44
* xref:core:howto/testing-against-model-api.adoc[]
5+
* xref:core:howto/modelql.adoc[]

0 commit comments

Comments
 (0)