summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 589fc36..9e4d912 100644
--- a/Makefile
+++ b/Makefile
@@ -437,8 +437,10 @@ docs: doc webdocs
# web/README.md). README.md and DESIGN.md are already markdown, so they are
# copied rather than converted, with a front-matter block in front and the
# logo block at the top pointed at the site's own copy. The specification
-# is typst's HTML export, which keeps the typeset maths; the PDF is copied
-# too, and the Doxygen HTML that `doc` wrote is copied to web/static/reference.
+# is converted from typst's HTML export by web/spec-md.py, which keeps the
+# heading ids the spec cross-references and carries the MathML over; the PDF
+# is copied too, and the Doxygen HTML that `doc` wrote is copied to
+# web/static/reference.
# Nothing is committed: the pages feed `hugo --source web`, and
# `make clean` removes them. WEBDOCS is source:weight:title.
#
@@ -478,6 +480,14 @@ webdocs: doc
else \
echo "webdocs: no typst, web/static/zash-spec.html not written"; \
fi
+ @if [ -f web/static/zash-spec.html ] && command -v pandoc >/dev/null 2>&1 \
+ && command -v python3 >/dev/null 2>&1; then \
+ python3 web/spec-md.py web/static/zash-spec.html \
+ web/content/docs/specification.md || exit 1; \
+ echo web/content/docs/specification.md; \
+ else \
+ echo "webdocs: needs typst, pandoc and python3, specification.md not written"; \
+ fi
@cp formal/zash-spec.pdf web/static/zash-spec.pdf
@if [ -d docs/html ]; then \
rm -rf web/static/reference \
@@ -508,6 +518,7 @@ clean:
rm -f zash.amblist
rm -rf docs cov $(ZTOOLS)
rm -f web/content/docs/readme.md web/content/docs/design.md \
+ web/content/docs/specification.md \
web/static/zash-spec.html web/static/zash-spec.pdf
rm -rf web/static/reference