From 2a3ac4a8450dd9f2279c85386b77a384485e6a33 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Wed, 10 May 2023 16:23:31 -0500 Subject: [PATCH] Add single-page html output --- Makefile | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index eea22e9..db3d19d 100644 --- a/Makefile +++ b/Makefile @@ -36,13 +36,14 @@ HTML_LOCAL_SRC := html_local_src HTML_SRC := html_src HTML_LOCAL_TARGET := local_html HTML_TARGET := html +HTML_SINGLE_TARGET := html-single ## ## Variables: ## ## LOCALHTML -## To generate html output and access it via "file://" URLs define this to -## something, e.g.:: make LOCALHTML=y html +## To generate multi-page html output and access it via "file://" URLs +## define this to something, e.g.:: make LOCALHTML=y html ifdef LOCALHTML ifndef SDB_HTML_FMT SDB_HTML_FMT := localhtml @@ -84,6 +85,7 @@ DOC_ROOT := /var/www/html/doc PDF_A4_PATH := $(DOC_ROOT)/$(PDF_A4_NAME) PDF_LETTER_PATH := $(DOC_ROOT)/$(PDF_LETTER_NAME) HTML_PATH := $(DOC_ROOT)/tech_spec +HTML_SINGLE_PATH := $(DOC_ROOT)/tech_spec_single # Locations where docs are built by sphinx SPHINX_PREFIX := $(PREFIX)/sphinx-doc @@ -91,6 +93,7 @@ SPHINX_BUILDDIR := $(SPHINX_PREFIX)/build SPHINX_BUILT_LATEX_A4 := $(SPHINX_BUILDDIR)/latex_a4 SPHINX_BUILT_LATEX_LETTER := $(SPHINX_BUILDDIR)/latex_letter SPHINX_BUILT_HTML := $(SPHINX_BUILDDIR)/$(HTML_TARGETDIR) +SPHINX_BUILT_HTML_SINGLE := $(SPHINX_BUILDDIR)/$(HTML_SINGLE_TARGET) # Locations of source files, original m4 and generated STOCK_SRCDIR := $(PREFIX)/src @@ -175,21 +178,30 @@ CLEAN_TARGETS := $(PREFIX)/requirements.txt.new \ $(SVG_FILES) $(PNG_FILES) \ $(PDF_A4_TARGET) $(PDF_LETTER_TARGET) +# Prerequsites for html generation +HTML_PREREQS := install-sphinx html_rst $(HTML_IMAGE_FILES) $(HTML_EPILOG) \ + $(HTML_STATIC_DIR) + ## ## The available targets for make (make TARGET) are: ## ## install Build all the docs and install on the website .PHONY: install -install: install-html install-pdf +install: install-html install-html-single install-pdf ## html Make the html docs with sphinx .PHONY: html -html: install-sphinx html_rst $(HTML_IMAGE_FILES) $(HTML_EPILOG) \ - $(HTML_STATIC_DIR) +html: $(HTML_PREREQS) $(SPHINXBUILD) -t html_epilog -b $(BUILDERNAME) \ $(HTML_SRCDIR) $(SPHINX_BUILT_HTML) +## html-single Make a single-page html doc with sphinx +.PHONY: html-single +html-single: $(HTML_PREREQS) + $(SPHINXBUILD) -t html_epilog -b singlehtml \ + $(HTML_SRCDIR) $(SPHINX_BUILT_HTML_SINGLE) + ## pdf Make pdf docs with sphinx .PHONY: pdf pdf: install-sphinx $(PDF_A4_TARGET) $(PDF_LETTER_TARGET) @@ -235,6 +247,13 @@ install-pdf: $(PDF_A4_PATH) $(PDF_LETTER_PATH) $(DOC_ROOT) install-html: html $(DOC_ROOT) rsync -rtO --delete --force $(SPHINX_BUILT_HTML)/ $(HTML_PATH) +## install-html-single +## Install the single-page html doc on the website +.PHONY: install-html-single +install-html-single: html-single $(DOC_ROOT) + rsync -rtO --delete --force \ + $(SPHINX_BUILT_HTML_SINGLE)/ $(HTML_SINGLE_PATH) + ## install-sphinx Install sphinx in a virtualenv .PHONY: install-sphinx install-sphinx: sphinx-venv $(SPHINX_VENV)/bin/sphinx-build -- 2.34.1