Skip to content

Commit

Permalink
Generate requirements markdown with inclusion in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robtaylor committed Oct 3, 2024
1 parent 590b45d commit 7f922ac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ docs/gen/*.tex: $(YAML)
.PHONY: reqs-md
reqs-md: install docs/gen/*.md
docs/gen/*.md: $(YAML)
$(DOORSTOP) publish all docs/gen --markdown
$(DOORSTOP) publish all docs/gen --markdown --index

.PHONY: reqs-pdf
reqs-pdf: reqs-latex
Expand Down
15 changes: 15 additions & 0 deletions docs/gen_reqs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os

from doorstop.core import publisher, builder
from doorstop.cli import utilities


def on_pre_build(config):
cwd = os.getcwd()
path = os.path.abspath(os.path.join(cwd, "docs/gen"))
tree = builder.build(cwd=cwd)

published_path = publisher.publish(tree, path, ".md", index=True)

if published_path:
utilities.show("published: {}".format(published_path))
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ theme: readthedocs

markdown_extensions:
- admonition
use_directory_urls: false
hooks:
- docs/gen_reqs.py

nav:
- Home: index.md
Expand All @@ -25,6 +28,7 @@ nav:
- Desktop Interface: gui/overview.md
- Web Interface: web.md
- Scripting Interface: api/scripting.md
- Doorstop's requirements: gen/index.md
- Reference:
- Tree: reference/tree.md
- Document: reference/document.md
Expand Down

0 comments on commit 7f922ac

Please sign in to comment.