diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 20:30:22 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 20:30:22 -0600 |
| commit | 1101f029610080c53ac857a258c6b1b0b64c4b88 (patch) | |
| tree | b2004564119085d0f75ba9043f6bdf4c55a5239b /Makefile | |
| parent | deb0ed011fe2cfc7058facb3f63b7feaeb8d4a8e (diff) | |
| download | zash-chore/c23-idioms.tar.gz | |
web: the specification as a page, converted from typst's HTMLchore/c23-idioms
typst writes no markdown, so the site had the typeset HTML export and no
page that a reader could search or link into. web/spec-md.py reduces the
export to what goldmark reads and hands it to pandoc, then puts back the
heading ids the spec cross-references itself by and carries the MathML
over untouched: browsers render it, so the page ships no TeX script.
`make docs` writes it with the other document pages, and the site stays
hand-written pages until someone runs that.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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 |
