Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: ドキュメント生成にJinja2とmizuを使うようにした。 #6

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
run: |
source venv/bin/activate
cd docs
make html
python3 -OO build.py
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./docs/build/html
path: ./docs
deploy:
environment:
name: github-pages
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
Cargo.lock

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -59,8 +60,8 @@ coverage.xml

.DS_Store

# Sphinx documentation
docs/_build/
# Documentation
docs/index.html

# PyCharm
.idea/
Expand All @@ -69,4 +70,4 @@ docs/_build/
.vscode/

# Pyenv
.python-version
.python-version
322 changes: 0 additions & 322 deletions Cargo.lock

This file was deleted.

20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

12 changes: 12 additions & 0 deletions docs/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# mizu - Build documentation

from mizu import parse
from jinja2 import Template, Environment, FileSystemLoader

env = Environment(loader=FileSystemLoader('.'), trim_blocks=False)
template = env.get_template('main.tpl')
with open("main.md", "r") as f:
raw = f.read()
text = template.render(content=parse(raw))
with open("index.html", "w") as f:
f.write(text)
Loading