diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..5bcfa0c5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,34 @@ +# .github/workflows/docs.yml +name: Build Docs + +on: + pull_request: + branches: + - master + paths: + - 'man/**' + - '**.md' + +jobs: + build-docs: + runs-on: ubuntu-latest + container: + image: ubuntu:24.04 + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + apt-get update + apt-get install -y \ + make \ + pandoc \ + python3-pip \ + texinfo \ + texlive-plain-generic + pip3 install md-toc --break-system-packages + + - name: Build docs + run: | + make doc-regenerate diff --git a/ChangeLog b/ChangeLog index 4d4c3198..29ceec38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2026-02-25 Mats Lidell + +* .github/workflows/docs.yml: New workflow + +* Makefile (TEXICMD): Fail build on errors + (doc-clean): Use make foreach for removing doc build artifacts. (Avoid + bash brace expansion.) Remove README.md.html and README.toc.md. + 2026-02-19 Bob Weiner * hui.el (hui:link-possible-types): Fix to include link-to-wikiword only if diff --git a/Makefile b/Makefile index b85276f4..7142e296 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,7 @@ EMACS = \emacs SITE_PRELOADS = # Command used to build the .info version of the user manual. -TEXICMD = texi2any +TEXICMD = texi2any --error-limit=0 # Ensure punctuation generated by $(TEXICMD) is ascii, not unicode (requires texi2any 7.0 or above). TEXI2INFO = $(TEXICMD) --no-split -c ASCII_PUNCTUATION=1 # Command used to build the .html version of the user manual. @@ -395,9 +395,12 @@ version: doc: version README.md.html manual # Convenience targets for regenerating the docs +DOC_SUFFIXES = log aux cp cpz fn fns ky toc vr vrs info pdf html .PHONY: doc-clean doc-regenerate doc-clean: - $(RM) man/hyperbole.{log,aux,cp*,fn*,ky*,toc,vr*,info,pdf,html} + $(RM) $(foreach suf,$(DOC_SUFFIXES),$(man_dir)/hyperbole.$(suf)) + $(RM) README.md.html README.toc.md + doc-regenerate: doc-clean doc # Build the Info, HTML and Postscript versions of the user manual @@ -422,10 +425,12 @@ $(man_dir)/hyperbole.html: $(TEXINFO_SRC) $(man_dir)/hyperbole.css $(man_dir)/te # # `pandoc' is available from: # https://github.com/jgm/pandoc -README.md.html: README.md README.toc.md +README.toc.md: README.md cp -p README.md README.toc.md && md_toc -p -m [TOC] github README.toc.md \ - && sed -i -e 's/^\[TOC\]//g' README.toc.md \ - && pandoc --from=gfm-tex_math_dollars --to=html+gfm_auto_identifiers -o README.md.html README.toc.md + && sed -i -e 's/^\[TOC\]//g' README.toc.md + +README.md.html: README.toc.md + pandoc --from=gfm-tex_math_dollars --to=html+gfm_auto_identifiers -o README.md.html README.toc.md # website maintenance: "https://www.gnu.org/software/hyperbole/" define confirm