From b577e1eae356fe9ddc8c573ccb7b288170b3403c Mon Sep 17 00:00:00 2001 From: jzbor Date: Tue, 7 Nov 2023 22:10:44 +0100 Subject: [PATCH] Adding mdBook documentation --- .github/workflows/docs-github-pages.yml | 32 +++++++-- book.toml | 13 ++++ docs/.gitignore | 1 + docs/SUMMARY.md | 12 ++++ docs/configuration.md | 1 + docs/examples.md | 19 +++++ docs/examples/mars-status.md | 13 ++++ docs/examples/touchegg.md | 5 ++ docs/examples/wallpaper-daemon.md | 9 +++ docs/examples/xdg-xmenu.md | 9 +++ INSTALLATION.md => docs/installation.md | 0 docs/introduction.md | 3 + docs/marsbar.md | 71 +++++++++++++++++++ marswm/src/docs/README.md => docs/marswm.md | 0 .../docs/QUICKSTART.md => docs/quickstart.md | 25 +++---- marsbar/README.md | 71 ------------------- marswm/README.md | 4 +- marswm/src/docs/mod.rs | 3 - marswm/src/docs/quick_start.rs | 1 - marswm/src/main.rs | 2 - 20 files changed, 194 insertions(+), 100 deletions(-) create mode 100644 book.toml create mode 100644 docs/.gitignore create mode 100644 docs/SUMMARY.md create mode 100644 docs/configuration.md create mode 100644 docs/examples.md create mode 100644 docs/examples/mars-status.md create mode 100644 docs/examples/touchegg.md create mode 100644 docs/examples/wallpaper-daemon.md create mode 100644 docs/examples/xdg-xmenu.md rename INSTALLATION.md => docs/installation.md (100%) create mode 100644 docs/introduction.md create mode 100644 docs/marsbar.md rename marswm/src/docs/README.md => docs/marswm.md (100%) rename marswm/src/docs/QUICKSTART.md => docs/quickstart.md (82%) delete mode 100644 marswm/src/docs/mod.rs delete mode 100644 marswm/src/docs/quick_start.rs diff --git a/.github/workflows/docs-github-pages.yml b/.github/workflows/docs-github-pages.yml index 0e91442d..c3927c4c 100644 --- a/.github/workflows/docs-github-pages.yml +++ b/.github/workflows/docs-github-pages.yml @@ -12,6 +12,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: 'latest' + - run: mdbook build . + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: './target/book' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + - name: Install X11 dependencies uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -25,8 +38,8 @@ jobs: with: command: doc args: --no-deps - - name: Create forwarding to actual index.html - run: echo '' > ./target/doc/index.html + # - name: Create forwarding to actual index.html + # run: echo '' > ./target/doc/index.html - name: Fix file permissions shell: sh run: | @@ -34,12 +47,21 @@ jobs: while read line; do echo "::warning title=Invalid file permissions automatically fixed::$line" done - - name: Setup Pages - uses: actions/configure-pages@v3 + + - name: Copy stuff around + shell: sh + run: + mkdir output + cp -r target/book output/ + cp -r target/doc output/crate + - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: './target/doc' + path: './output' + - name: Setup Pages + uses: actions/configure-pages@v3 - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 + diff --git a/book.toml b/book.toml new file mode 100644 index 00000000..7a359cc3 --- /dev/null +++ b/book.toml @@ -0,0 +1,13 @@ +[book] +authors = ["jzbor"] +language = "en" +multilingual = false +src = "docs" +title = "MARSWM Documentation" + +[build] +build-dir = "target/book" + +[output.html] +default-theme = "rust" +preferred-dark-theme = "ayu" diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..7585238e --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +book diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 00000000..3821cb72 --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,12 @@ +# Summary +- [Introduction](introduction.md) +- [Installation](./installation.md) +- [Quick Start](./quickstart.md) +- [Configuration](./configuration.md) + - [marswm](./marswm.md) + - [marsbar](./marswm.md) +- [Examples](./examples.md) + - [mars-status.sh](examples/mars-status.md) + - [touchegg.conf](examples/touchegg.md) + - [wallpaper-daemon.sh](examples/wallpaper-daemon.md) + - [xdg-xmenu.py](examples/xdg-xmenu.md) diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 00000000..a025a48b --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1 @@ +# Configuration diff --git a/docs/examples.md b/docs/examples.md new file mode 100644 index 00000000..8b51bd1b --- /dev/null +++ b/docs/examples.md @@ -0,0 +1,19 @@ +# Examples +This chapter contains a couple of example scripts and configurations. +All examples are available on [Github](https://github.com/jzbor/marswm/tree/master/examples). + +## Installing Configurations +Most config files go into `~/.config//.`. +For example marswm's main config goes into `~/.config/marswm/marswm.yaml`. + +## Installing Scripts +To install a script you will first need to install all of its dependencies. + +Then place the script into a directory that is listed in your `$PATH`. +It is suggested to use `~/.local/bin/` to store all of your personal scripts. +You can check if that is in your path with `echo $PATH` and add it to your `~/.profile` otherwise. + +You will also have to make the script executable: +```sh +chmod +x