From: Maria Matejka Date: Sat, 25 Jan 2025 22:01:11 +0000 (+0100) Subject: Doc: building singlepage version with the appropriate template X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d510d63accf09cb03ee08707c383cb500bbde801;p=thirdparty%2Fbird.git Doc: building singlepage version with the appropriate template --- diff --git a/doc/Makefile b/doc/Makefile index c17648877..1f3ee4743 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -31,11 +31,12 @@ $(o)%.md: $(s)%.sgml @false else LINUXDOC_PANDOC_PARSER := $(srcdir)/tools/linuxdoc.lua +SINGLEPAGE_HTML_TEMPLATE := $(srcdir)/tools/doc-template.html $(o)%.md: $(s)%.sgml $(LINUXDOC_PANDOC_PARSER) $(objdir)/.dir-stamp $(PANDOC) -f $(LINUXDOC_PANDOC_PARSER) -s -t markdown -o $@ $< -$(o)%-singlepage.html: $(o)%.md - $(PANDOC) -f markdown -t html5 -s -o $@ $< +$(o)%-singlepage.html: $(s)%.sgml $(SINGLEPAGE_HTML_TEMPLATE) $(LINUXDOC_PANDOC_PARSER) $(objdir)/.dir-stamp + $(PANDOC) -f $(LINUXDOC_PANDOC_PARSER) -t html5 --shift-heading-level-by=1 --section-divs --table-of-contents --toc-depth=3 --template=$(SINGLEPAGE_HTML_TEMPLATE) -o $@ $< endif diff --git a/tools/doc-template.html b/tools/doc-template.html new file mode 100644 index 000000000..cd782ff77 --- /dev/null +++ b/tools/doc-template.html @@ -0,0 +1,40 @@ +{%- set title = "$pagetitle$" %} +{%- set is_docs = True %} +{%- set template_part = "header" %} +{%- set authors = [ $for(author-meta)$ "$author-meta$", $endfor$ ] %} +{%- set meta_additional = { "author": authors, } %} +{%- include "main.html" %} + +
+
+
+
+
+
+

{{ title }}

+

Authors: + {%- for a in authors %} + {{ a.split('<')[0][:-1] }}{% if not loop.last %}, {% endif %} + {%- endfor %} +

+

$abstract$

+
+
+
+
+
+ +
+ $body$ +
+
+
+
+
+{% set template_part = "footer" %} +{% include "main.html" %}