diff --git a/document/core/Makefile b/document/core/Makefile index 0654f3f2f0..27047a6a3f 100644 --- a/document/core/Makefile +++ b/document/core/Makefile @@ -76,7 +76,7 @@ spectec: SPECTECPAT = $(SPECTECSPEC)/*.$(SPECTECEXT) SPECTECFILES = $(shell ls $(SPECTECPAT)) -RSTDIRS = $(shell ls -d [a-z]*/ util/[a-z]*/) +RSTDIRS = $(shell ls -d [a-z]*/ util/[a-z]*/ | grep -v util/katex) RSTFILES = $(shell ls -d *.rst [a-z]*/*.rst) $(GENERATED) CTRLFILES = $(shell ls Makefile *.* util/*.* util/bikeshed/*.*) $(shell ls static/*) ALLFILES = $(RSTDIRS) $(CTRLFILES) _splice #$(RSTFILES) @@ -97,12 +97,9 @@ $(SPLICEDIR)/$(BUILDDIR): $(SPLICEDIR) $(BUILDDIR): $(SPLICEDIR)/$(BUILDDIR) ln -s $< $@ -$(RSTDIRS:%=$(SPLICEDIR)/%):: $(SPLICEDIR) +$(RSTDIRS:%=$(SPLICEDIR)/%): $(SPLICEDIR) mkdir -p $@ -$(SPLICEDIR)/util/katex:: util/katex - cp -R $< $@ # F it! - $(SPLICEDIR)/_splice: $(SPLICEDIR) $(RSTFILES) $(SPECTECFILES) @echo Modified $? @echo ${if ${filter %.$(SPECTECEXT), $?}, $(RSTFILES), ${filter %.rst, $?}} >$@ @@ -184,13 +181,16 @@ singlehtml: $(SPLICEDFILES) singlehtml-nested: $(GENERATED) $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml -.PHONY: bikeshed bikeshed-nested +.PHONY: bikeshed bikshed-fixup bikeshed-nested bikeshed: $(SPLICEDFILES) + (cd util/katex/ && yarn && yarn build && npm install --only=prod) + mkdir -p $(SPLICEDIR)/util/katex + cp -Rf util/katex/* $(SPLICEDIR)/util/katex (cd $(SPLICEDIR) && make bikeshed-nested) @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/html/bikeshed/." -bikeshed-nested: $(GENERATED) +bikeshed-fixup: $(GENERATED) $(SPHINXBUILD) -b singlehtml -c util/bikeshed \ $(ALLSPHINXOPTS) $(BUILDDIR)/bikeshed_singlehtml python3 util/bikeshed_fixup.py $(BUILDDIR)/bikeshed_singlehtml/index.html \ @@ -201,10 +201,12 @@ bikeshed-nested: $(GENERATED) @tail -n10 _build/bikeshed_singlehtml/index_fixed.html @echo @echo ========================================================================= + +bikeshed-nested: bikeshed-fixup mkdir -p $(BUILDDIR)/bikeshed_mathjax/ bikeshed spec --md-status=$(W3C_STATUS) --md-deadline=$(DEADLINE) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html mkdir -p $(BUILDDIR)/html/bikeshed/ - (cd util/katex/ && yarn && yarn build && npm install --only=prod) + # (cd util/katex/ && yarn && yarn build && npm install --only=prod) python3 util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \ >$(BUILDDIR)/html/bikeshed/index.html mkdir -p $(BUILDDIR)/html/bikeshed/katex/dist/ diff --git a/document/core/conf.py b/document/core/conf.py index cf3cd2baa6..ec1b99d5d1 100644 --- a/document/core/conf.py +++ b/document/core/conf.py @@ -518,5 +518,12 @@ 'macros': { 'multicolumn': ['', 2] # Bummer, MathJax can't handle multicolumn, ignore it } + }, + 'options': { + 'menuOptions': { + 'settings': { + 'enrich': False, # Activating this apparently increases page load times by 4x + } + } } } diff --git a/document/core/util/bikeshed_fixup.py b/document/core/util/bikeshed_fixup.py index 25ed648e9e..e996c9392b 100755 --- a/document/core/util/bikeshed_fixup.py +++ b/document/core/util/bikeshed_fixup.py @@ -56,8 +56,8 @@ def Main(): # an error — which in turn causes the W3C pubrules checker to refuse to # autopublish the resulting bikeshed output. data = data.replace( - """\href{#binary-sint}{\href{#syntax-int}""", - """{\href{#syntax-int}""") + """\\href{#binary-sint}{\\href{#syntax-int}""", + """{\\href{#syntax-int}""") # Strip the entire element from the the sphinx output — because it # contains several ,