Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Deploy documentation

on:
# If specified, the workflow will be triggered automatically once you push to the `main` branch.
# Replace `main` with your branch’s name
push:
branches:
- dev
paths:
- 'docs/**'
- 'docs_zh/**'
- 'docs_en/**'
- '.github/workflows/doc-publish.yml'

# Specify to run a workflow manually from the Actions tab on GitHub
workflow_dispatch:

# Gives the workflow permissions to clone the repo and create a page deployment
permissions:
id-token: write
pages: write

env:
# Name of module and id separated by a slash
INSTANCE: docs/docs
INSTANCE_NAME: docs
IS_GROUP: true
# Replace HI with the ID of the instance in capital letters
ARTIFACT: webHelpDOCS2-all.zip
# Writerside docker image version
# see https://www.jetbrains.com/help/writerside/deploy-docs-to-github-pages.html
DOCKER_VERSION: '2025.04.8412'

jobs:
build:
runs-on: ubuntu-latest
outputs:
config_json: ${{ steps.output-config-json.outputs.config_json }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}
is-group: ${{ env.IS_GROUP }}

- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7

- name: Upload documentation test reports
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: 'report.json'
path: |
artifacts/report.json
retention-days: 7

- name: Unzip artifact
run: unzip -O UTF-8 -qq artifacts/${{ env.ARTIFACT }} -d dir

- name: Output documentation config.json
id: output-config-json
run: |
echo "config_json=$(cat dir/config.json)" >> $GITHUB_OUTPUT

# Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors
test:
# Requires build job results
needs: build
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
is-group: ${{ env.IS_GROUP }}

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Requires the build job results
needs: test
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docs

- name: Unzip artifact
run: unzip -O UTF-8 -qq artifacts/${{ env.ARTIFACT }} -d dir

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
86 changes: 86 additions & 0 deletions .github/workflows/doc-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Test documentation

on:
# If specified, the workflow will be triggered automatically once you push to the `main` branch.
# Replace `main` with your branch’s name
pull_request:
branches:
- dev
# Specify to run a workflow manually from the Actions tab on GitHub
workflow_dispatch:

env:
# Name of module and id separated by a slash
INSTANCE: docs/docs
# Replace HI with the ID of the instance in capital letters
ARTIFACT: webHelpDOCS2-all.zip
# Writerside docker image version
DOCKER_VERSION: '2025.04.8412'
# Add the variable below to upload Algolia indexes
# Replace HI with the ID of the instance in capital letters
# ALGOLIA_ARTIFACT: algolia-indexes-HI.zip
IS_GROUP: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}
is-group: ${{ env.IS_GROUP }}

- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7

- name: Upload documentation test reports
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: 'report.json'
path: |
artifacts/report.json
retention-days: 7

# Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors
test:
name: Test documentation built
# Requires build job results
needs: build
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
is-group: ${{ env.IS_GROUP }}

- name: Unzip artifact
run: unzip -O UTF-8 -qq artifacts/${{ env.ARTIFACT }} -d dir

- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: dist
path: dir
retention-days: 7
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ tasks.create("createChangelog") {
}
}
}

tasks.register<UpdateWritersideVersionTask>("updateWritersideVersion")
34 changes: 34 additions & 0 deletions buildSrc/src/main/kotlin/UpdateWritersideVersionTask.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction

abstract class UpdateWritersideVersionTask : DefaultTask() {
/**
* Update `<var name="version" value="xxx" />`'s value with current version
* in docs_en/v.list` and `docs_zh/v.list`.
*/
@TaskAction
fun action() {
val currentVersion = IProject.version

// Update version in both Writerside v.list files
val vListFiles = listOf(
project.file("docs_en/v.list"),
project.file("docs_zh/v.list")
)

vListFiles.forEach { file ->
if (file.exists()) {
val content = file.readText()
// Use regex to replace only the version variable's value attribute
val updatedContent = content.replaceFirst(
Regex("""(<var\s+name="version"\s+value=")[^"]*("\s*/>)"""),
"$1$currentVersion$2"
)
file.writeText(updatedContent)
project.logger.info("Updated version to {} in {}", currentVersion, file.path)
} else {
project.logger.warn("Warning: {} does not exist", file.path)
}
}
}
}
9 changes: 9 additions & 0 deletions docs/cfg/build-groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE build-groups SYSTEM "https://resources.jetbrains.com/writerside/1.0/build-groups.dtd">
<build-groups xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-groups.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<build-group name="docs">
<instance instance-id="den" alias="Kotlin Suspend Transform | Documentation" path="/en"/>
<instance instance-id="dzh" alias="Kotlin Suspend Transform | 文档" path="/zh"/>
</build-group>
</build-groups>
7 changes: 7 additions & 0 deletions docs/cfg/buildprofiles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE buildprofiles SYSTEM "https://resources.jetbrains.com/writerside/1.0/build-profiles.dtd">
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<variables></variables>
</buildprofiles>
11 changes: 11 additions & 0 deletions docs/docs_libraries.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">

<instance-profile id="docs_libraries"
name="docs_libraries"
is-library="true"
start-page="snippets.topic">

<toc-element topic="snippets.topic"/>
</instance-profile>
Binary file added docs/images/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions docs/topics/snippets.topic
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE topic SYSTEM "https://resources.jetbrains.com/writerside/1.0/html-entities.dtd">
<topic xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" is-library="true" id="snippets" title="snippets"
help-id="snippets">
<!-- Put your snippets here -->
<snippet id="cover-image">
<img src="cover.png" alt="cover"/>
</snippet>

<snippet id="gradle-plugin-dsl">
<code-block lang="Kotlin">
plugins {
kotlin("jvm") version "$KOTLIN_VERSION" // or multiplatform
id("love.forte.plugin.suspend-transform") version "%version%"
// Others ...
}
</code-block>
</snippet>

<snippet id="gradle-plugin-legacy">
<code-block lang="Kotlin">
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath("love.forte.plugin.suspend-transform:suspend-transform-plugin-gradle:%version%")
}
}

plugins {
id("org.jetbrains.kotlin.jvm") // or multiplatform?
id("love.forte.plugin.suspend-transform")
// Others ...
}
</code-block>
</snippet>
</topic>
2 changes: 2 additions & 0 deletions docs/v.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<vars>
</vars>
8 changes: 8 additions & 0 deletions docs/writerside.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ihp SYSTEM "https://resources.jetbrains.com/writerside/1.0/ihp.dtd">
<ihp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/writerside-cfg.xsd">
<images dir="images"/>
<instance src="docs_libraries.tree"/>
<topics dir="topics"/>
</ihp>
9 changes: 9 additions & 0 deletions docs_en/cfg/build-groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE build-groups SYSTEM "https://resources.jetbrains.com/writerside/1.0/build-groups.dtd">
<build-groups xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-groups.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<build-group name="docs">
<instance instance-id="den" alias="Kotlin Suspend Transform | Documentation" path="/en"/>
<instance instance-id="dzh" alias="Kotlin Suspend Transform | 文档" path="/zh"/>
</build-group>
</build-groups>
13 changes: 13 additions & 0 deletions docs_en/cfg/buildprofiles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE buildprofiles SYSTEM "https://resources.jetbrains.com/writerside/1.0/build-profiles.dtd">
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<variables></variables>
<build-profile instance="den">
<variables>
<noindex-content>false</noindex-content>
</variables>
</build-profile>

</buildprofiles>
28 changes: 28 additions & 0 deletions docs_en/den.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">

<instance-profile id="den"
status="eap"
name="Kotlin Suspend Transform Compiler Plugin"
start-page="Overview.md">

<toc-element topic="Overview.md"/>
<toc-element topic="Installation.md"/>
<toc-element topic="Getting-Started.md"/>
<toc-element toc-title="Configuration">
<toc-element topic="Configuration.md"/>
<toc-element topic="Default-Transformers.md"/>
<toc-element topic="Custom-Transformers.md"/>
</toc-element>
<toc-element toc-title="Features">
<toc-element topic="MarkName.md"/>
</toc-element>

<toc-element toc-title="Possibly Useful">
<toc-element topic="JsExport-Integration.md"/>
<toc-element topic="WasmJS-Limitations.md"/>
<toc-element topic="Examples.md"/>
</toc-element>

</instance-profile>
Loading
Loading