From db38d53191982c5fde1050c58d51f1dfcfcd9b17 Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Thu, 2 Jan 2025 10:06:04 +0000 Subject: [PATCH] Add docs dependencies and tooling - Install Mkdocs - Install Mike (for documetation versioning) - Install pymdown-extensions (so we can leverage Snippets, for injecting code from other files inline in the Markdown files) Also introduce three hash commands: - hatch run docs:build - hatch run docs:serve - hatch run docs:release The first builds the docs locally, the second serves them at localhost:8080 and the last creates a version release using Mike and sets it as the latest. --- mkdocs.yml | 19 +++++++++++++++++++ pyproject.toml | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 mkdocs.yml diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..805775d3 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,19 @@ +site_name: DAG Factory Documentation +extra: + version: + provider: mike + +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.snippets: + check_paths: true + base_path: [ "." ] + - pymdownx.superfences + +plugins: + - mike: + alias_type: symlink diff --git a/pyproject.toml b/pyproject.toml index cd5b87fc..f9bab9c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,6 +101,22 @@ filterwarnings = ["ignore::DeprecationWarning"] minversion = "6.0" markers = ["integration", "callbacks"] +###################################### +# DOCS +###################################### + +[tool.hatch.envs.docs] +dependencies = [ + "mkdocs", + "mike", + "pymdown-extensions", +] + +[tool.hatch.envs.docs.scripts] +build = "mike deploy --push dev" +serve = "mike serve" +release = "version=$(python -W ignore -c 'import dagfactory; print(dagfactory.__version__)') && mike deploy --push --update-aliases $version latest" + ###################################### # THIRD PARTY TOOLS ######################################