From b928a6edaff7f6b1c33fd1aab32a81228bf13b31 Mon Sep 17 00:00:00 2001 From: Lorenzo Lewis Date: Thu, 20 Jan 2022 21:32:57 +0000 Subject: [PATCH] tauri-studio JS doc generation (#3249) * Add `generate-docs` command to JS tooling * Stop generating Rust docs, update JS docs generation * Change target folder for js copy * Add recursive to copy * Add in ARCHITECTURE.md copy * Add in guides copy * Change architecture output dir, fix guides destination * Revert back to GitHub.workspace path * Change cp to rsync to be able to exclude * Fix source path * Change to render title better * Revert "Change to render title better" This reverts commit 72b78f3901fc9f2a492ddb713721a919c2f7c2bc. * Fix broken links --- .github/workflows/update-docs.yml | 63 +++++++++---------- .../{development.md => development-cycle.md} | 0 docs/development/intro.md | 2 +- docs/guides/migration.md | 2 +- docs/guides/splashscreen.md | 2 +- docs/guides/webdriver/example/webdriverio.md | 2 +- tooling/api/.gitignore | 3 + tooling/api/package.json | 3 +- 8 files changed, 39 insertions(+), 38 deletions(-) rename docs/development/{development.md => development-cycle.md} (100%) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 47ea49a8d..b9d8fe6ba 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -40,46 +40,43 @@ jobs: with: repository: tauri-apps/tauri-search-bot path: tauri-search-bot - - name: install webkit2gtk - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - # Rust - - name: generate rust docs - working-directory: ./tauri/core/tauri - run: cargo doc --no-deps - - name: run rustdocusaurus - uses: tauri-apps/rustdocusaurus/github-action@v1 - with: - originPath: ./tauri/target/doc/ - targetPath: ./tauri-docs/docs/en/api/rust/ - sidebarPath: "${{ github.workspace }}/tauri-docs/sidebars/rustdoc.json" - linksRoot: "" - cratesToProcess: "tauri" + # Any Rust documentation is currently disabled while we're falling back to docs.rs - # TypeScript - - name: install API deps + # - name: install webkit2gtk + # run: | + # sudo apt-get update + # sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf + + # # Rust + # - name: generate rust docs + # working-directory: ./tauri/core/tauri + # run: cargo doc --no-deps + # - name: run rustdocusaurus + # uses: tauri-apps/rustdocusaurus/github-action@v1 + # with: + # originPath: ./tauri/target/doc/ + # targetPath: ./tauri-docs/docs/en/api/rust/ + # sidebarPath: "${{ github.workspace }}/tauri-docs/sidebars/rustdoc.json" + # linksRoot: "" + # cratesToProcess: "tauri" + + - name: Generate JS docs working-directory: ./tauri/tooling/api - run: yarn && yarn add typescript@4.2 - - name: run typedocusaurus - uses: tauri-apps/typedocusaurus@v1 - with: - originPath: ./tauri/tooling/api/ - sidebarFile: "${{ github.workspace }}/tauri-docs/sidebars/typedoc.json" - targetPath: ${{ github.workspace }}/tauri-docs/docs/en/api/js - docusaurusPath: ./tauri-docs/ + run: yarn && yarn generate-docs - # Moving docs for Indexation - - name: copy docs - working-directory: ./tauri - run: | - mv docs/sidebar.json ${{ github.workspace }}/tauri-docs/sidebars/core.json - cp -r docs/!(.templates) ${{ github.workspace }}/tauri-docs/docs/en - mv ARCHITECTURE.md ${{ github.workspace }}/tauri-docs/docs/en/about/architecture.md + - name: Copy JS docs + run: cp -r tauri/tooling/api/docs/* tauri-docs/docs/api/js/ + + - name: Copy Architecture doc + run: cp -r tauri/ARCHITECTURE.md tauri-docs/docs/about/ + - name: Copy Guides docs + run: rsync -avr --exclude '.templates' tauri/docs/ tauri-docs/docs/ + # Indexing - name: meilisearch indexation + uses: tauri-apps/docusaurus-meilisearch-indexer@v1 with: version: ${{ github.event.inputs.version || github.event.release.tag_name }} diff --git a/docs/development/development.md b/docs/development/development-cycle.md similarity index 100% rename from docs/development/development.md rename to docs/development/development-cycle.md diff --git a/docs/development/intro.md b/docs/development/intro.md index 66607d567..2c06ba3ea 100644 --- a/docs/development/intro.md +++ b/docs/development/intro.md @@ -11,7 +11,7 @@ Here you will find guides and techniques to start a new project or add to your o ## Tauri Development Workflow - [Integrate With Tauri](/docs/development/integration) -- [Development Cycle](/docs/development/development) +- [Development Cycle](/docs/development/development-cycle) - [Debugging](/docs/development/debugging) - [CI/CD](/docs/development/ci-cd) - [Cross-Platform Compilation](/docs/development/cross-platform) diff --git a/docs/guides/migration.md b/docs/guides/migration.md index 63c9b889c..5cd2b3f6a 100644 --- a/docs/guides/migration.md +++ b/docs/guides/migration.md @@ -53,7 +53,7 @@ Update your `tauri.conf.json` like this: - make the `window` definition into an array and call it `windows` - remove `inliner` -> for more information about the config see [here](../../api/config.md) +> for more information about the config see [here](../api/config.md) ```diff { diff --git a/docs/guides/splashscreen.md b/docs/guides/splashscreen.md index a2738fb87..81d444a73 100644 --- a/docs/guides/splashscreen.md +++ b/docs/guides/splashscreen.md @@ -35,7 +35,7 @@ Now, your main window will be hidden and the splashscreen window will show when ### Waiting for Webpage -If you are waiting for your web code, you'll want to create a `close_splashscreen` [command](../command.md). +If you are waiting for your web code, you'll want to create a `close_splashscreen` [command](command.md). ```rust title=src-tauri/main.rs use tauri::Manager; diff --git a/docs/guides/webdriver/example/webdriverio.md b/docs/guides/webdriver/example/webdriverio.md index d0d262721..3571f3baf 100644 --- a/docs/guides/webdriver/example/webdriverio.md +++ b/docs/guides/webdriver/example/webdriverio.md @@ -273,4 +273,4 @@ of configuration and a single command to run it! Even better, we didn't have to [finished example project]: https://github.com/chippers/hello_tauri [example Application setup]: setup [Mocha]: https://mochajs.org/ -[suggest reading the documentation]: (https://webdriver.io/docs/configurationfile) +[suggest reading the documentation]: https://webdriver.io/docs/configurationfile diff --git a/tooling/api/.gitignore b/tooling/api/.gitignore index 0169607dd..e77e5b1c3 100644 --- a/tooling/api/.gitignore +++ b/tooling/api/.gitignore @@ -62,3 +62,6 @@ typings/ debug.log package-lock.json .vscode/settings.json + +# Documentation output +docs \ No newline at end of file diff --git a/tooling/api/package.json b/tooling/api/package.json index 0af8dc893..03fff3522 100644 --- a/tooling/api/package.json +++ b/tooling/api/package.json @@ -18,7 +18,8 @@ "lint-fix": "eslint --fix --ext ts \"./src/**/*.ts\"", "lint:lockfile": "lockfile-lint --path yarn.lock --type yarn --validate-https --allowed-hosts npm yarn", "format": "prettier --write --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore", - "format:check": "prettier --check --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore" + "format:check": "prettier --check --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore", + "generate-docs": "typedoc src --githubPages false --readme none --entryDocument index.md --hideInPageTOC true" }, "repository": { "type": "git",