From 3790bd4aa373187a36e4667873a178ae50f7ecba Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Fri, 21 Oct 2022 16:07:25 +0200 Subject: doc: make stylesheets configurable Before this change, all stylesheets were hardcoded. With this change, stylesheets can be defined at configure stage. * configure.ac: Add new options to configure stylesheets: --enable-html-stylesheet=FILE --enable-txt-stylesheet=FILE --enable-pdf-stylesheet=FILE --enable-man-stylesheet=FILE * doc/custom-html.xsl: Rename to doc/custom-html.xsl.in, parametrize html stylesheet. * doc/custom-man.xsl: Rename to doc/custom-man.xsl.in, parametrize man stylesheet. * doc/.gitignore: Add custom-man.xsl and custom-html.xsl. * doc/adg/Makefile.am: Use stylesheet variables. * doc/mwg/Makefile.am: Likewise. * doc/sag/Makefile.am: Likewise. Resolves: https://github.com/linux-pam/linux-pam/pull/499 --- doc/.gitignore | 2 ++ doc/adg/Makefile.am | 6 +++--- doc/custom-html.xsl | 18 ------------------ doc/custom-html.xsl.in | 18 ++++++++++++++++++ doc/custom-man.xsl | 9 --------- doc/custom-man.xsl.in | 9 +++++++++ doc/mwg/Makefile.am | 6 +++--- doc/sag/Makefile.am | 6 +++--- 8 files changed, 38 insertions(+), 36 deletions(-) delete mode 100644 doc/custom-html.xsl create mode 100644 doc/custom-html.xsl.in delete mode 100644 doc/custom-man.xsl create mode 100644 doc/custom-man.xsl.in (limited to 'doc') diff --git a/doc/.gitignore b/doc/.gitignore index e04c8de3..ab4604bf 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -2,3 +2,5 @@ pam.sgml MODULES-SGML /*/*.txt /*/html/ +custom-man.xsl +custom-html.xsl diff --git a/doc/adg/Makefile.am b/doc/adg/Makefile.am index 77bd7a99..b795b1a4 100644 --- a/doc/adg/Makefile.am +++ b/doc/adg/Makefile.am @@ -21,7 +21,7 @@ if ENABLE_GENERATE_PDF --stringparam section.autolabel 1 \ --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 3 --xinclude --nonet \ - http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $< > Linux-PAM_ADG.fo + $(PDF_STYLESHEET) $< > Linux-PAM_ADG.fo $(FO2PDF) Linux-PAM_ADG.fo $@ else echo "No fo2pdf processor installed, skip PDF generation" @@ -33,7 +33,7 @@ Linux-PAM_ADG.txt: $(XMLS) $(DEP_XMLS) --stringparam section.autolabel 1 \ --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 3 --xinclude --nonet \ - http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< | $(BROWSER) > $@ + $(TXT_STYLESHEET) $< | $(BROWSER) > $@ html/Linux-PAM_ADG.html: $(XMLS) $(DEP_XMLS) @test -d html || mkdir -p html @@ -46,7 +46,7 @@ html/Linux-PAM_ADG.html: $(XMLS) $(DEP_XMLS) --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 3 --xinclude --nonet \ --stringparam chunker.output.encoding UTF-8 \ - http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $< + $(HTML_STYLESHEET) $< distclean-local: -rm -rf html Linux-PAM_ADG.txt Linux-PAM_ADG.pdf diff --git a/doc/custom-html.xsl b/doc/custom-html.xsl deleted file mode 100644 index fdd5df7d..00000000 --- a/doc/custom-html.xsl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/doc/custom-html.xsl.in b/doc/custom-html.xsl.in new file mode 100644 index 00000000..b2eaf150 --- /dev/null +++ b/doc/custom-html.xsl.in @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/doc/custom-man.xsl b/doc/custom-man.xsl deleted file mode 100644 index a3408e6c..00000000 --- a/doc/custom-man.xsl +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/doc/custom-man.xsl.in b/doc/custom-man.xsl.in new file mode 100644 index 00000000..258627bf --- /dev/null +++ b/doc/custom-man.xsl.in @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/doc/mwg/Makefile.am b/doc/mwg/Makefile.am index 2bbb2d0b..688e6cb3 100644 --- a/doc/mwg/Makefile.am +++ b/doc/mwg/Makefile.am @@ -21,7 +21,7 @@ if ENABLE_GENERATE_PDF --stringparam section.autolabel 1 \ --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 3 --xinclude --nonet \ - http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $< > Linux-PAM_MWG.fo + $(PDF_STYLESHEET) $< > Linux-PAM_MWG.fo $(FO2PDF) Linux-PAM_MWG.fo $@ else echo "No fo2pdf processor installed, skip PDF generation" @@ -33,7 +33,7 @@ Linux-PAM_MWG.txt: $(XMLS) $(DEP_XMLS) --stringparam section.autolabel 1 \ --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 3 --xinclude --nonet \ - http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< | $(BROWSER) > $@ + $(TXT_STYLESHEET) $< | $(BROWSER) > $@ html/Linux-PAM_MWG.html: $(XMLS) $(DEP_XMLS) @test -d html || mkdir -p html @@ -46,7 +46,7 @@ html/Linux-PAM_MWG.html: $(XMLS) $(DEP_XMLS) --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 3 --xinclude --nonet \ --stringparam chunker.output.encoding UTF-8 \ - http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $< + $(HTML_STYLESHEET) $< distclean-local: -rm -rf html Linux-PAM_MWG.txt Linux-PAM_MWG.pdf diff --git a/doc/sag/Makefile.am b/doc/sag/Makefile.am index 31816aa0..84fd383f 100644 --- a/doc/sag/Makefile.am +++ b/doc/sag/Makefile.am @@ -22,7 +22,7 @@ if ENABLE_GENERATE_PDF --stringparam section.autolabel 1 \ --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 2 --xinclude --nonet \ - http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $< > Linux-PAM_SAG.fo + $(PDF_STYLESHEET) $< > Linux-PAM_SAG.fo $(FO2PDF) Linux-PAM_SAG.fo $@ else echo "No fo2pdf processor installed, skip PDF generation" @@ -34,7 +34,7 @@ Linux-PAM_SAG.txt: $(XMLS) $(DEP_XMLS) --stringparam section.autolabel 1 \ --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 2 --xinclude --nonet \ - http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< | $(BROWSER) > $@ + $(TXT_STYLESHEET) $< | $(BROWSER) > $@ html/Linux-PAM_SAG.html: $(XMLS) $(DEP_XMLS) @test -d html || mkdir -p html @@ -47,7 +47,7 @@ html/Linux-PAM_SAG.html: $(XMLS) $(DEP_XMLS) --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 2 --xinclude --nonet \ --stringparam chunker.output.encoding UTF-8 \ - http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $< + $(HTML_STYLESHEET) $< distclean-local: -rm -rf html Linux-PAM_SAG.txt Linux-PAM_SAG.pdf -- cgit v1.2.3