From 2b8abb2b4bac6226821b0764d6a958af64b21b5f Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sat, 9 Nov 2024 12:49:26 +0100 Subject: [PATCH] docs: set up mdbook --- .github/workflows/gh-pages.yml | 54 ++++++++++++++++++++++++++++++++++ book/.gitignore | 1 + book/book.toml | 17 +++++++++++ book/src/SUMMARY.md | 3 ++ book/src/highlightos.md | 5 ++++ 5 files changed, 80 insertions(+) create mode 100644 .github/workflows/gh-pages.yml create mode 100644 book/.gitignore create mode 100644 book/book.toml create mode 100644 book/src/SUMMARY.md create mode 100644 book/src/highlightos.md diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..2727327 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,54 @@ +name: Github Pages + +on: + push: + branches: + - main + tags: + - '*' + workflow_dispatch: + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v2 + with: + mdbook-version: 'latest' + + - run: mdbook build book + + deploy: + environment: + name: gh-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + permissions: + contents: write + needs: build + steps: + - name: Set output directory + run: | + OUTDIR=$(basename ${{ github.ref }}) + echo "OUTDIR=$OUTDIR" >> $GITHUB_ENV + + - name: Deploy stable + uses: peaceiris/actions-gh-pages@v4 + if: startswith(github.ref, 'refs/tags/') + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book/book + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book/book + destination_dir: ./${{ env.OUTDIR }} diff --git a/book/.gitignore b/book/.gitignore new file mode 100644 index 0000000..7585238 --- /dev/null +++ b/book/.gitignore @@ -0,0 +1 @@ +book diff --git a/book/book.toml b/book/book.toml new file mode 100644 index 0000000..45fb2fb --- /dev/null +++ b/book/book.toml @@ -0,0 +1,17 @@ +[book] +authors = ["Adam Perkowski"] +language = "en" +multilingual = false +src = "src" +title = "HighlightOS" + +[output.html] +cname = "os.adamperkowski.dev" +#default-theme = "colibri" +#preferred-dark-theme = "colibri" +git-repository-url = "https://github.com/adamperkowski/highlightos" +edit-url-template = "https://github.com/adamperkowski/highlightos/edit/master/book/{path}" +#additional-css = ["custom.css"] + +[output.html.search] +use-boolean-and = true diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md new file mode 100644 index 0000000..a49cb16 --- /dev/null +++ b/book/src/SUMMARY.md @@ -0,0 +1,3 @@ +# Summary + +- [HighlightOS](./highlightos.md) diff --git a/book/src/highlightos.md b/book/src/highlightos.md new file mode 100644 index 0000000..c9bcb3c --- /dev/null +++ b/book/src/highlightos.md @@ -0,0 +1,5 @@ +# HighlightOS + +x86_64 OS (kernel) made completely from scratch in Assembly & Rust + +Documentation for bleeding-edge main can be found at [https://os.adamperkowski.dev/main](https://os.adamperkowski.dev/main).