瀏覽代碼

Added support for target html for documentation build system.

Greger V. Teigre 20 年之前
父節點
當前提交
cd2709bbbf
共有 2 個文件被更改,包括 55 次插入0 次删除
  1. 15 0
      Makefile.doc
  2. 40 0
      doc/stylesheets/html.chunked.xsl

+ 15 - 0
Makefile.doc

@@ -32,6 +32,11 @@ DEP_XSL ?= $(ROOT_DIR)/doc/stylesheets/dep.xsl
 #
 XHTML_XSL ?= $(ROOT_DIR)/doc/stylesheets/xhtml.xsl
 
+#
+# Default stylesheet used to generate HTML
+#
+HTML_XSL ?= $(ROOT_DIR)/doc/stylesheets/html.chunked.xsl
+
 #
 # Stylesheet used to generate plain text documents,
 # this is usually the one used for xhtml
@@ -74,10 +79,12 @@ all: xhtml
 xml_files = $(addsuffix .xml, $(DOCUMENTS))
 dep_files = $(addsuffix .d, $(DOCUMENTS))
 xhtml_files = $(addsuffix .xhtml, $(DOCUMENTS))
+html_files = $(addsuffix .html, $(DOCUMENTS))
 txt_files = $(addsuffix .txt, $(DOCUMENTS))
 pdf_files = $(addsuffix .pdf, $(DOCUMENTS))
 
 xhtml: $(xhtml_files)
+html: $(html_files)
 txt: $(txt_files)
 pdf: $(pdf_files)
 
@@ -89,6 +96,14 @@ pdf: $(pdf_files)
         --stringparam html.ext ".xhtml" \
         $(XHTML_XSL) $<
 
+%.html: %.xml %.d $(alldep) $(HTML_XSL)
+	XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
+        --xinclude \
+        --stringparam base.dir "$(OUTPUT_DIR)/" \
+        --stringparam root.filename "$(basename $<)" \
+        --stringparam html.ext ".html" \
+        $(HTML_XSL) $<
+
 %.fo: %.xml $(alldep) $(FO_XSL)
 	XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
         --xinclude \

+ 40 - 0
doc/stylesheets/html.chunked.xsl

@@ -0,0 +1,40 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:exsl="http://exslt.org/common"
+		version="1.0"
+                exclude-result-prefixes="exsl">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://nwalsh.com/docbook/xsl/ for copyright
+     and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/>
+<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/html/manifest.xsl"/>
+
+<!-- Why is chunk-code now xsl:included?
+
+Suppose you want to customize *both* the chunking algorithm used *and* the
+presentation of some elements that may be chunks. In order to do that, you
+must get the order of imports "just right". The answer is to make your own
+copy of this file, where you replace the initial import of "docbook.xsl"
+with an import of your own base.xsl (that does its own import of docbook.xsl).
+
+Put the templates for changing the presentation of elements in your base.xsl.
+
+Put the templates that control chunking after the include of chunk-code.xsl.
+
+Voila! (Man I hope we can do this better in XSLT 2.0)
+
+-->
+
+<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-code.xsl"/>
+
+</xsl:stylesheet>