Skip to content

Commit

Permalink
PTFE-671 setup mkdocs build (#313)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Carmet <[email protected]>
  • Loading branch information
Abubakarr99 and tcarmet authored Aug 4, 2023
1 parent 3954f11 commit 4f8561e
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
},
"remoteUser": "vscode",
"postCreateCommand": "poetry install --no-interaction --no-ansi --no-root",
"postCreateCommand": "poetry install --no-interaction --no-ansi --no-root --group=docs --group=dev",
"postAttachCommand": {
"compose": "docker compose --profile develop up --build",
"watch": "docker compose alpha watch"
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tests
.trunk
.venv
.hypothesis
site
24 changes: 24 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: build documentation

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: |
pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: 3.x
cache: poetry
- name: Install Dependencies
run: |
poetry install --only docs
- run: poetry run mkdocs build --strict
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ __pycache__
.venv
.pytest_cache
.hypothesis
site
15 changes: 9 additions & 6 deletions docs/development/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,18 @@ It will be used to process the jobs that will be created by the runner manager.

## Typing

Static typing is enforced by [`pyright`](https://microsft.github.io/pyright/).
Static typing is enforced by [pyright].

It's configuration is located in the
[`pyrightconfig.json`](../../pyrightconfig.json) file.
It's configuration is located in the [`pyrightconfig.json`] file.

It is run automatically when `trunk check` is run.

To know more about `pyright` and how to use it, check out
[pyright's documentation](https://microsoft.github.io/pyright/).
To know more about `pyright` and how to use it,
check out [pyright]'s documentation.

### Stub files

Stub files are located in the [`typings`](../../typings) directory.
Stub files are located in the [`typings`] directory.

`pyright` will raise errors if it cannot find the stub files for the libraries
that are used.
Expand All @@ -70,3 +69,7 @@ poetry run pyright --createstub <library>
For more information checkout [pyright's documentation]

[pyright's documentation]: https://microsoft.github.io/pyright/#/type-stubs?id=cleaning-up-generated-type-stubs

[`typings`]: https://github.com/scality/runner-manager/tree/main/typings
[`pyrightconfig.json`]: https://github.com/scality/runner-manager/blob/main/pyrightconfig.json
[pyright]: https://microsoft.github.io/pyright/
65 changes: 65 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
site_name: Runner Manager
repo_url: https://github.com/scality/runner-manager
repo_name: scality/runner-manager
edit_uri: edit/main/docs/
theme:
icon:
repo: fontawesome/brands/github
name: material
include_search_page: false
search_index_only: true
language: en
features:
- navigation.indexes
- navigation.instant
- navigation.sections
- navigation.expand
- navigation.tabs
- navigation.tabs.sticky
- search.highlight
- search.share
- search.suggest
- toc.follow
- header.autohide
palette:
# Palette toggle for light mode
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
font:
text: Roboto
code: Roboto Mono

nav:
- Home: index.md
- Development:
- development/index.md
- Code: development/code.md
- Concepts: development/concepts.md
- Configuration: development/configuration.md
- Environment: development/environment.md
- Testing: development/testing.md
- Workflows: development/workflows.md

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- tables
- attr_list
- md_in_html
- meta
- admonition
- pymdownx.details
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ rq = "^1.15.1"
pyyaml = "^6.0.1"
redis = "^4.6.0"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
mkdocs-material = "^9.1.21"

mkdocs = "^1.4.2"

[tool.poetry.group.dev.dependencies]
connexion = "^2.14.2"
Expand Down

0 comments on commit 4f8561e

Please sign in to comment.