From 9a688e820238ab056cf04e45ab8d6e94e2265c3c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 16 Oct 2023 23:57:03 +0100 Subject: [PATCH] Set up mdbook in github pages (#26367) --- .github/workflows/docs.yml | 52 ++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + book.toml | 26 +++++++++++++++++++ docs/SUMMARY.md | 38 ++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 book.toml create mode 100644 docs/SUMMARY.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..7e4e7036d0 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,52 @@ +name: Deploy documentation + +on: + push: + branches: [develop] + workflow_dispatch: {} + +jobs: + docs: + name: GitHub Pages + runs-on: ubuntu-latest + steps: + - name: Fetch element-desktop + uses: actions/checkout@v4 + with: + repository: vector-im/element-desktop + path: element-desktop + + - name: Fetch element-web + uses: actions/checkout@v4 + with: + path: element-web + + - name: Fetch matrix-react-sdk + uses: actions/checkout@v4 + with: + repository: matrix-org/matrix-react-sdk + path: matrix-react-sdk + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: "0.4.10" + + - name: Install mdbook-combiner + run: cargo install mdbook-combiner + + - name: Build docs + run: | + mkdir docs + mv element-desktop/docs docs/element-desktop + mv element-web/docs docs/element-web + mv matrix-react-sdk/docs docs/matrix-react-sdk + mdbook-combiner -m docs + cp element-web/book.toml . + mdbook build + + - name: Deploy to gh pages + uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book diff --git a/.gitignore b/.gitignore index b279ef0bf9..3d737137ce 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ electron/pub # Auto-generated file /src/modules.ts /build_config.yaml +/book diff --git a/book.toml b/book.toml new file mode 100644 index 0000000000..24275dc61c --- /dev/null +++ b/book.toml @@ -0,0 +1,26 @@ +# Documentation for possible options in this file is at +# https://rust-lang.github.io/mdBook/format/config.html +[book] +title = "Element Web & Desktop" +authors = ["New Vector Ltd.", "The Matrix.org Foundation C.I.C."] +language = "en" +multilingual = false + +# The directory that documentation files are stored in +src = "docs" + +[build] +# Prevent markdown pages from being automatically generated when they're +# linked to in SUMMARY.md +create-missing = false + +[output.html] +# Remove the numbers that appear before each item in the sidebar, as they can +# get quite messy as we nest deeper +no-section-label = true + +# The source code URL of the repository +git-repository-url = "https://github.com/vector-im/element-web" + +# The path that the docs are hosted on +site-url = "/element-web/" diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 0000000000..00a81e9e41 --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,38 @@ +# Summary + +- [Introduction](../README.md) + +# Usage + +- [Betas](betas.md) +- [Labs](labs.md) + +# Setup + +- [Config](config.md) +- [Custom home page](custom-home.md) +- [Kubernetes](kubernetes.md) +- [Jitsi](jitsi.md) +- [Encryption](e2ee.md) + +# Build + +- [Customisations](customisations.md) +- [Modules](modules.md) +- [Native Node modules](native-node-modules.md) + +# Contribution + +- [Choosing an issue](choosing-an-issue.md) +- [Translation](translating.md) +- [Netlify builds](pr-previews.md) +- [Code review](review.md) + +# Development + +- [App load order](app-load.md) +- [Translation](translating-dev.md) +- [Theming](theming.md) +- [Memory profiling](memory-profiles-and-leaks.md) +- [Jitsi](jitsi-dev.md) +- [Feature flags](feature-flags.md)