Browse Source

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
Lorenzo Lewis 3 years ago
parent
commit
b928a6edaf

+ 30 - 33
.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
+
+      # - 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"
 
-      # TypeScript
-      - name: install API deps
+      - 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 }}

+ 0 - 0
docs/development/development.md → docs/development/development-cycle.md


+ 1 - 1
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)

+ 1 - 1
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
   {

+ 1 - 1
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;

+ 1 - 1
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

+ 3 - 0
tooling/api/.gitignore

@@ -62,3 +62,6 @@ typings/
 debug.log
 package-lock.json
 .vscode/settings.json
+
+# Documentation output
+docs

+ 2 - 1
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",