Commit 52f70a0d authored by Tristan Van Berkom's avatar Tristan Van Berkom

doc/Makefile: Run to generate .html files from .run files

If you need an example output of bst to put in the documentation,
just add a .run file to the doc/examples directory and it will result
in a similarly named .html file in doc/source/examples.
parent e112a88f
......@@ -24,7 +24,9 @@ ALLSPHINXOPTS = -W -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS)
# the i18n builder cannot share the environment and doctrees with the others
.PHONY: all templates html devhelp
.PHONY: all clean templates templates-clean html devhelp
# Canned recipe for generating plugin api skeletons
# $1 = the plugin directory
......@@ -56,9 +58,14 @@ define plugin-doc-skeleton
# We set PYTHONPATH here because source/ sys.modules hacks dont seem to help sphinx-build import the plugins
all: html devhelp
clean: templates-clean
rm -rf build
# Generate rst templates for the docs using a mix of sphinx-apidoc and
# our 'plugin-doc-skeleton' routine for plugin pages.
......@@ -68,10 +75,23 @@ templates:
$(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/elements,elements)
$(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/sources,sources)
# Generate the html fragments of colorized BuildStream terminal output only
# if they don't yet exist. This is expensive so you need to run `make clean` first
# if you want to regenerate them.
SESSION_HTML = $(patsubst sessions/,source/sessions/%.html,$(wildcard sessions/*.run))
$(BST2HTML) -o [email protected] --description $(patsubst source/sessions/%.html,sessions/,[email protected])
rm -rf source/elements
rm -rf source/sources
rm -rf source/sessions
# Targets which generate docs with sphinx build
html devhelp: templates
html devhelp: templates $(SESSION_HTML)
@echo "Building [email protected]..."
PYTHONPATH=$(CURDIR)/../buildstream/plugins \
$(SPHINXBUILD) -b [email protected] $(ALLSPHINXOPTS) "$(BUILDDIR)/[email protected]" \
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment