From 75f8d9801237b885e7f8e83a802cda5cc92d3a3d Mon Sep 17 00:00:00 2001 From: "Andriy Kushnir (Orhideous)" Date: Tue, 30 Jan 2024 21:39:42 +0200 Subject: [PATCH] Add scaffold for docs --- .github/workflows/docs.yml | 45 ++++++++++++++ docs/faq.md | 5 ++ docs/hardware.md | 5 ++ docs/index.md | 8 +++ docs/requirements.txt | 5 ++ mkdocs.yml | 119 +++++++++++++++++++++++++++++++++++++ 6 files changed, 187 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/faq.md create mode 100644 docs/hardware.md create mode 100644 docs/index.md create mode 100644 docs/requirements.txt create mode 100644 mkdocs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..1d19ed3 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,45 @@ +name: Build documentation +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install python + uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: Setup cache + uses: actions/cache@v2 + with: + key: ${{ github.ref }} + path: .cache + - name: Setup dependencies + run: pip install -r docs/requirements.txt + - name: Build docs + run: mkdocs build --strict + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./site + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 0000000..85e85ea --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,5 @@ +--- +hide: + - navigation +--- + diff --git a/docs/hardware.md b/docs/hardware.md new file mode 100644 index 0000000..85e85ea --- /dev/null +++ b/docs/hardware.md @@ -0,0 +1,5 @@ +--- +hide: + - navigation +--- + diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..93a5cbf --- /dev/null +++ b/docs/index.md @@ -0,0 +1,8 @@ +--- +hide: + - navigation + - toc +--- + +# niimprint + diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..32bd08c --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,5 @@ +cairosvg~=2.7.1 +mkdocs-material~=9.4.14 +mkdocs-minify-plugin~=0.7.1 +pillow~=10.1.0 + diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..8d43cd0 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,119 @@ +site_name: niimprint +site_url: https://orhideous.github.io/niimprint +edit_uri: blob/main/docs/ # Change the master branch to main as we are using main as a main branch +site_author: niimprint authors +site_description: >- + Python app for Niimbot label printers. + +# Repository +repo_name: orhideous/niimprint +repo_url: https://github.com/orhideous/niimprint + +# Copyright +copyright: Copyright © 2024 niimprint authors + +# Configuration +theme: + name: material + features: + - announce.dismiss + - content.action.edit + - content.action.view + - content.code.annotate + - content.code.copy + # - content.tabs.link + - content.tooltips + # - header.autohide + # - navigation.expand + - navigation.footer + - navigation.indexes + # - navigation.instant + # - navigation.prune + - navigation.sections + - navigation.tabs + # - navigation.tabs.sticky + - navigation.top + - navigation.tracking + - search.highlight + - search.share + - search.suggest + - toc.follow + # - toc.integrate + palette: + - scheme: default + primary: white + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to light mode + font: + text: Roboto + code: Roboto Mono + favicon: assets/favicon.png + +# Plugins +plugins: + - search: + separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])' + - minify: + minify_html: true + - social: {} + +# Customization +extra: + annotate: + json: [.s2] + social: + - icon: fontawesome/brands/github + link: https://github.com/orhideous/niimprint + +# Extensions +markdown_extensions: + - abbr + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - toc: + permalink: true + - pymdownx.arithmatex: + generic: true + - pymdownx.betterem: + smart_enable: all + - pymdownx.caret + - pymdownx.details + - pymdownx.emoji: + emoji_generator: !!python/name:material.extensions.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.magiclink: + repo_url_shorthand: true + user: squidfunk + repo: mkdocs-material + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + +# Page tree +nav: + - Home: index.md + - FAQ: faq.md + - Printers & Tapes: hardware.md