Skip to content

Commit

Permalink
cruft update
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo committed Apr 18, 2022
1 parent 1d49ce2 commit e8afa3c
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/iterative/py-template",
"commit": "78a385738c1de8e6d4da5bfcff338418eb067701",
"commit": "be42a3eec1a3ed07c3e4237b6a2aac58a0f4552b",
"context": {
"cookiecutter": {
"project_name": "dvc-render",
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Documentation

on:
push:
branches:
- main
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- run: pip install '.[docs]'
- run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Publish docs
run: mkdocs gh-deploy
1 change: 1 addition & 0 deletions docs/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Generate the code reference pages."""

from pathlib import Path

import mkdocs_gen_files

for path in sorted(Path("src").rglob("*.py")): #
module_path = path.relative_to("src").with_suffix("") #
doc_path = path.relative_to("src").with_suffix(".md") #
full_doc_path = Path("reference", doc_path) #

parts = list(module_path.parts)

if parts[-1] == "__init__": #
parts = parts[:-1]
doc_path = doc_path.with_name("index.md")
full_doc_path = full_doc_path.with_name("index.md")
elif parts[-1] == "__main__":
continue

with mkdocs_gen_files.open(full_doc_path, "w") as fd: #
identifier = ".".join(parts) #
print("::: " + identifier, file=fd) #

mkdocs_gen_files.set_edit_path(full_doc_path, path) #
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Welcome to Dvc Render

- [API Reference](./reference/dvc_render/index.md)
33 changes: 33 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
site_name: Dvc Render

theme:
name: material
logo: assets/logo.svg
favicon: assets/logo.svg
palette:
primary: white
accent: deep purple
icon:
repo: fontawesome/brands/github

repo_url: https://github.com/iterative/dvc-render
repo_name: iterative/dvc-render

extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/iterative/

plugins:
- search
- gen-files:
scripts:
- docs/gen_ref_pages.py
- section-index
- mkdocstrings:
handlers:
python:
rendering:
show_submodules: no
watch:
- src/dvc_render
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ install_requires=
tabulate>=0.8.7

[options.extras_require]
docs =
mkdocs==1.3.0
mkdocs-gen-files==0.3.4
mkdocs-material==8.2.8
mkdocs-section-index==0.3.4
mkdocstrings-python==0.6.6
tests =
pytest==6.2.5
pytest-sugar==0.9.4
Expand All @@ -39,6 +45,7 @@ tests =
pytest-test-utils>=0.0.6
dev =
%(tests)s
%(docs)s

[options.packages.find]
exclude =
Expand Down

0 comments on commit e8afa3c

Please sign in to comment.