From 6b9def211c5db577ed17d6f78a8db940e4e7c558 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 14 Nov 2024 13:16:23 +0100 Subject: [PATCH] Attempt to implement docs build for the CI --- .github/workflows/build_docs.yaml | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index a5843cb8590..292fcf8038b 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -81,27 +81,15 @@ jobs: cp -r target/aarch64-linux-android/doc/i_slint_backend_android_activity/ target/doc/ cp -r target/aarch64-linux-android/doc/i_slint_backend_winit/ target/doc/ cp -r target/aarch64-linux-android/doc/i_slint_backend_testing/ target/doc/ + - name: "Generate Screenshots for Example Snippets" + working-directory: docs + run: cargo run -p slint-docsnapper -- src/content --overwrite + - name: "Install Node dependencies for Slint and Node docs" + run: pnpm install --frozen-lockfile - name: "Slint Language Documentation" - run: | - searchbox_html=docs/reference/_templates/searchbox.html - sed -i "s/\$TYPESENSE_SEARCH_API_KEY/${{ secrets.TYPESENSE_SEARCH_API_KEY }}/g" $searchbox_html - sed -i "s/\$TYPESENSE_SERVER_PROTOCOL/https/g" "$searchbox_html" - if [ "$RELEASE_INPUT" == "true" ]; then - version=$(sed -n 's/^version = "\(.*\)"/\1/p' docs/reference/conf.py) - sed -i "s/\$TYPESENSE_INDEX_NAME/$version/g" "$searchbox_html" - sed -i 's/sitemap_url_scheme = "master\/docs\/slint\/{link}"/sitemap_url_scheme = "{version}docs\/slint\/{link}"/' docs/reference/conf.py - sed -i "s/snapshots.slint.dev\/master/releases.slint.dev\/$version/" docs/editor/codemirror.js docs/editor/rollup.config.js - else - sed -i "s/\$TYPESENSE_INDEX_NAME/master/g" "$searchbox_html" - fi - sed -i "s/\$TYPESENSE_SERVER_PORT/443/g" "$searchbox_html" - sed -i "s/\$TYPESENSE_SERVER_URL/typesense.slint.dev/g" "$searchbox_html" - cargo xtask slintdocs --show-warnings + run: cargo xtask slintdocs - name: "Node docs" - - run: | - pnpm install --frozen-lockfile --ignore-scripts - pnpm run docs + run: pnpm run docs working-directory: api/node - name: Generate a token @@ -143,12 +131,11 @@ jobs: path: | target/doc target/cppdocs/html - target/slintdocs/html + docs/dist api/node/docs - docs/site - name: "Check for docs warnings in internal crates" run: cargo doc --workspace --no-deps --all-features --exclude slint-node --exclude pyslint --exclude mcu-board-support --exclude printerdemo_mcu --exclude carousel --exclude test-* --exclude plotter --exclude uefi-demo --exclude ffmpeg --exclude gstreamer-player --exclude slint-cpp --exclude slint-python - name: Clean cache # Don't cache docs to avoid them including removed classes being published run: | - rm -rf target/doc target/cppdocs target/slintdocs api/node/docs + rm -rf target/doc target/cppdocs api/node/docs