From a8add1a1c6c594be7c5bbff7b73db7064ca0e1dd Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Wed, 24 Jul 2024 00:04:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96KDoc;=20=E6=B7=BB=E5=8A=A0gta?= =?UTF-8?q?g;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-kdoc.yml | 59 ++++++++++++++ .simbot/dokka-assets/css/kdoc-style.css | 32 ++++++-- .simbot/dokka-assets/logo-icon-light.svg | 78 +++++++++++++++++++ .simbot/dokka-assets/logo-icon.svg | 40 +++++----- .../includes/page_metadata.ftl | 26 +++++++ .../kook-dokka-partial-configure.gradle.kts | 41 +++++++--- .../simbot-kook-dokka-multi-module.gradle.kts | 35 ++++++--- 7 files changed, 262 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/publish-kdoc.yml create mode 100644 .simbot/dokka-assets/logo-icon-light.svg create mode 100644 .simbot/dokka-templates/includes/page_metadata.ftl diff --git a/.github/workflows/publish-kdoc.yml b/.github/workflows/publish-kdoc.yml new file mode 100644 index 00000000..270acf22 --- /dev/null +++ b/.github/workflows/publish-kdoc.yml @@ -0,0 +1,59 @@ +name: Publish KDoc +on: + workflow_dispatch: + + +env: + JAVA_VERSION: 21 + JAVA_DISTRIBUTION: zulu + GRADLE_VERSION: 8.5 + IS_CI: true + GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} + GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} + GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + GRADLE_OPTS: "-XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8" + +jobs: + deploy-doc: + name: Deploy-doc + runs-on: ubuntu-latest + steps: + # 检出仓库代码 + - name: Check out repo + uses: actions/checkout@v4 + with: + persist-credentials: false + fetch-depth: 0 + # setup Java + - name: Setup java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: 21 + + # setup Gradle + - name: Gradle generate documentation + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: 8.5 + arguments: | + -Porg.gradle.jvmargs="-Xmx4g -Xms4g -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8" + -Porg.gradle.daemon=false + --info + --warning-mode all + -x test + --build-cache + dokkaHtmlMultiModule + + - name: Push to doc repository + uses: peaceiris/actions-gh-pages@v3 + with: + personal_token: ${{ secrets.PUSH_TOKEN }} + external_repository: simple-robot-library/simbot3-api-docs + publish_branch: kdoc-deploy/component-kook + publish_dir: ./build/dokka/html + # deploy to sub dir + destination_dir: components/kook + diff --git a/.simbot/dokka-assets/css/kdoc-style.css b/.simbot/dokka-assets/css/kdoc-style.css index 83a1461d..f06f72cc 100644 --- a/.simbot/dokka-assets/css/kdoc-style.css +++ b/.simbot/dokka-assets/css/kdoc-style.css @@ -1,8 +1,26 @@ -.library-name a::before { - background: url("../images/logo-icon.svg") center no-repeat; - background-size: contain; - width: 40px; - height: 40px; - top: -12px; - left: -50px; +/* + * Copyright (c) 2024. ForteScarlet. + * + * Project https://github.com/simple-robot/simpler-robot + * Email ForteScarlet@163.com + * + * This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Lesser GNU General Public License for more details. + * + * You should have received a copy of the Lesser GNU General Public License + * along with this program. If not, see . + * + */ + +:root { + --dokka-logo-image-url: url('../images/logo-icon-light.svg'); } diff --git a/.simbot/dokka-assets/logo-icon-light.svg b/.simbot/dokka-assets/logo-icon-light.svg new file mode 100644 index 00000000..4cb36253 --- /dev/null +++ b/.simbot/dokka-assets/logo-icon-light.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.simbot/dokka-assets/logo-icon.svg b/.simbot/dokka-assets/logo-icon.svg index 4cb36253..a1d8512f 100644 --- a/.simbot/dokka-assets/logo-icon.svg +++ b/.simbot/dokka-assets/logo-icon.svg @@ -22,57 +22,57 @@ - --> - + - + - - - + + + - + - + - - + + - + - - + + diff --git a/.simbot/dokka-templates/includes/page_metadata.ftl b/.simbot/dokka-templates/includes/page_metadata.ftl new file mode 100644 index 00000000..2f6156ce --- /dev/null +++ b/.simbot/dokka-templates/includes/page_metadata.ftl @@ -0,0 +1,26 @@ +<#macro display> + ${pageName} + <@template_cmd name="pathToRoot"> +