diff --git a/.github/workflows/validate-docs.yaml b/.github/workflows/validate-docs.yaml new file mode 100644 index 00000000..b5c2d483 --- /dev/null +++ b/.github/workflows/validate-docs.yaml @@ -0,0 +1,45 @@ +name: validate-docs + +on: + pull_request: + push: + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Taskfile + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Setup Go + uses: actions/setup-go@v2 + + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.8" + architecture: "x64" + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_docs.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install Python dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install -r ./requirements_docs.txt + + - name: Build docs website + # Ensure the docs build is sane, these docs won't be published + run: task docs:build diff --git a/Taskfile.yml b/Taskfile.yml index 8864b3d0..6c4e8328 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -26,6 +26,11 @@ tasks: cmds: - npx {{ .PRETTIER }} --write "**/*.md" + docs:build: + desc: Build documentation website contents + cmds: + - mkdocs build -s + build: desc: Build the project cmds: diff --git a/docs/README.md b/docs/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/docs/img/icon_mac_light.png b/docs/img/icon_mac_light.png new file mode 100644 index 00000000..b06aa7f3 Binary files /dev/null and b/docs/img/icon_mac_light.png differ diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..bd536c46 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,59 @@ +# Project information +site_name: Arduino Firmware Uploader +site_description: A firmware uploader/updater for Arduino Boards. +site_url: https://arduino.github.io/FirmwareUploader/ + +# Repository +repo_name: arduino/FirmwareUploader +repo_url: https://github.com/arduino/FirmwareUploader +edit_uri: "" + +# Copyright +copyright: Copyright 2021 ARDUINO SA (http://www.arduino.cc/) + +# Theme +theme: + name: material + logo: img/icon_mac_light.png + palette: + primary: teal + accent: orange + +# Extensions +markdown_extensions: + - markdown.extensions.admonition + - markdown.extensions.codehilite: + guess_lang: false + - markdown.extensions.def_list + - markdown.extensions.footnotes + - markdown.extensions.meta + - markdown.extensions.toc: + permalink: true + - pymdownx.arithmatex + - pymdownx.betterem: + smart_enable: all + - pymdownx.caret + - pymdownx.critic + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:pymdownx.emoji.twemoji + emoji_generator: !!python/name:pymdownx.emoji.to_svg + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.magiclink: + repo_url_shorthand: true + user: arduino + repo: FirmwareUploader + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.superfences + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + - mdx_truly_sane_lists: + nested_indent: 2 + truly_sane: true + +# Navigation +nav: + - Documentation Home: README.md diff --git a/requirements_docs.txt b/requirements_docs.txt new file mode 100644 index 00000000..65255692 --- /dev/null +++ b/requirements_docs.txt @@ -0,0 +1,6 @@ +mkdocs<1.2 +mkdocs-material<5 +mike==0.5.1 +gitpython +click<7.2 +mdx_truly_sane_lists==1.2