Commits

aura committed 85eac9b

add build for website manual vs offline manual

Comments (0)

Files changed (8)

+^output/*

build-manual-offline.sh

+DIR=`pwd`
+OUT=$DIR/output/manual/offline
+
+echo "Replacing xlink-able entities ..."
+php $DIR/tools/xlink-entities.php
+
+echo "Validating manual source ..."
+xmllint --noout --postvalid --xinclude $DIR/source/manual.xml
+
+INVALID=$?
+if [ $INVALID -eq 0 ]; then
+    
+    echo "Removing previous manual ..."
+    rm -rf $OUT/*
+    
+    echo "Copying style sheet ..."
+    cp $DIR/source/manual/style.css $OUT/style.css
+    
+    echo "Copying figures ..."
+    cp -r $DIR/source/manual/figures $OUT/figures
+    
+    echo "Copying images ..."
+    cp -r $DIR/source/manual/images $OUT/images
+    
+    echo "Building new manual ..."
+    xsltproc \
+        --xinclude \
+        --output $OUT/index.html \
+        $DIR/source/manual-offline.xsl \
+        $DIR/source/manual.xml
+    
+    echo "Highlighting PHP code ..."
+    php $DIR/tools/highlight.php $OUT
+    
+    echo "Done."
+
+else
+    
+    echo "${INVALID}: Not valid, so not building."    
+    exit $INVALID
+    
+fi

build-manual-website.sh

+DIR=`pwd`
+OUT=$DIR/output/manual/website
+
+echo "Replacing xlink-able entities ..."
+php $DIR/tools/xlink-entities.php
+
+echo "Validating manual source ..."
+xmllint --noout --postvalid --xinclude $DIR/source/manual.xml
+
+INVALID=$?
+if [ $INVALID -eq 0 ]; then
+    
+    echo "Removing previous manual ..."
+    rm -rf $OUT/*
+    
+    echo "Copying style sheet ..."
+    cp $DIR/source/manual/style.css $OUT/style.css
+    
+    echo "Copying figures ..."
+    cp -r $DIR/source/manual/figures $OUT/figures
+    
+    echo "Copying images ..."
+    cp -r $DIR/source/manual/images $OUT/images
+    
+    echo "Building new manual ..."
+    xsltproc \
+        --xinclude \
+        --output $OUT/index.html \
+        $DIR/source/manual-website.xsl \
+        $DIR/source/manual.xml
+    
+    echo "Highlighting PHP code ..."
+    php $DIR/tools/highlight.php $OUT
+    
+    echo "Done."
+
+else
+    
+    echo "${INVALID}: Not valid, so not building."    
+    exit $INVALID
+    
+fi

build-manual.sh

-echo "Replacing xlink-able entities ..."
-php tools/xlink-entities.php
-
-echo "Validating manual source ..."
-xmllint --noout --postvalid --xinclude source/manual.xml
-
-INVALID=$?
-if [ $INVALID -eq 0 ]; then
-    
-    echo "Removing previous manual ..."
-    rm -rf output/manual/*
-    
-    echo "Copying style sheet ..."
-    cp source/manual/style.css output/manual/style.css
-    
-    echo "Copying figures ..."
-    svn export source/manual/figures output/manual/figures
-    
-    echo "Copying images ..."
-    svn export source/manual/images output/manual/images
-    
-    echo "Building new manual ..."
-    xsltproc \
-        --xinclude \
-        --output output/manual/index.html \
-        source/xhtml.xsl \
-        source/manual.xml
-    
-    echo "Highlighting PHP code ..."
-    php tools/highlight.php
-    
-    echo "Done."
-
-else
-    
-    echo "${INVALID}: Not valid, so not building."    
-    exit $INVALID
-    
-fi

source/manual-offline.xsl

+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"   
+	version="1.0">
+    
+    <xsl:import href="../docbook-xsl-ns-1.75.2/xhtml/chunk.xsl" />
+    
+    <xsl:param name="use.extensions">0</xsl:param>
+    <xsl:param name="use.id.as.filename">1</xsl:param>
+    <xsl:param name="html.ext">.html</xsl:param>
+    <xsl:param name="base.dir">./</xsl:param>
+    <xsl:param name="chunk.fast">1</xsl:param>
+    <xsl:param name="make.valid.html">1</xsl:param>
+    <xsl:param name="section.autolabel">1</xsl:param>
+    <xsl:param name="generate.index" select="1"></xsl:param>
+    <xsl:param name="section.label.includes.component.label">1</xsl:param>
+    <xsl:param name="chunker.output.indent">yes</xsl:param>
+    <xsl:param name="chunker.output.encoding">UTF-8</xsl:param>
+    <xsl:param name="chunk.first.sections">1</xsl:param>
+    <xsl:param name="chunk.tocs.and.lots">0</xsl:param>
+    <xsl:param name="html.extra.head.links">1</xsl:param>
+    <xsl:param name="generate.manifest">0</xsl:param>
+    <xsl:param name="admon.graphics">1</xsl:param>
+    <xsl:param name="admon.style"></xsl:param>
+    <xsl:param name="html.stylesheet">style.css</xsl:param>
+    <xsl:param name="header.rule">0</xsl:param>
+    <xsl:param name="footer.rule">0</xsl:param>
+    <xsl:param name="toc.max.depth">3</xsl:param>
+    
+    <xsl:template name="user.header.navigation">
+        <!-- stuff put here appears before the top navigation area -->
+    </xsl:template>
+    
+    <xsl:template name="user.footer.navigation">
+        <!-- stuff put here appears after the bottom navigation area -->
+        <xsl:element name="div">
+            <xsl:attribute name="class">revinfo</xsl:attribute>
+            <xsl:value-of select="//pubdate[1]"/>
+        </xsl:element>
+    </xsl:template>
+
+</xsl:stylesheet>

source/manual-website.xsl

+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"   
+	version="1.0">
+    
+    <xsl:import href="../docbook-xsl-ns-1.75.2/xhtml/chunk.xsl" />
+    
+    <xsl:param name="use.extensions">0</xsl:param>
+    <xsl:param name="use.id.as.filename">1</xsl:param>
+    <xsl:param name="html.ext"></xsl:param>
+    <xsl:param name="base.dir">./</xsl:param>
+    <xsl:param name="chunk.fast">1</xsl:param>
+    <xsl:param name="make.valid.html">1</xsl:param>
+    <xsl:param name="section.autolabel">1</xsl:param>
+    <xsl:param name="generate.index" select="1"></xsl:param>
+    <xsl:param name="section.label.includes.component.label">1</xsl:param>
+    <xsl:param name="chunker.output.indent">yes</xsl:param>
+    <xsl:param name="chunker.output.encoding">UTF-8</xsl:param>
+    <xsl:param name="chunk.first.sections">1</xsl:param>
+    <xsl:param name="chunk.tocs.and.lots">0</xsl:param>
+    <xsl:param name="html.extra.head.links">1</xsl:param>
+    <xsl:param name="generate.manifest">0</xsl:param>
+    <xsl:param name="admon.graphics">1</xsl:param>
+    <xsl:param name="admon.style"></xsl:param>
+    <xsl:param name="html.stylesheet">style.css</xsl:param>
+    <xsl:param name="header.rule">0</xsl:param>
+    <xsl:param name="footer.rule">0</xsl:param>
+    <xsl:param name="toc.max.depth">3</xsl:param>
+    
+    <xsl:template name="user.header.navigation">
+        <!-- stuff put here appears before the top navigation area -->
+    </xsl:template>
+    
+    <xsl:template name="user.footer.navigation">
+        <!-- stuff put here appears after the bottom navigation area -->
+        <xsl:element name="div">
+            <xsl:attribute name="class">revinfo</xsl:attribute>
+            <xsl:value-of select="//pubdate[1]"/>
+        </xsl:element>
+    </xsl:template>
+
+</xsl:stylesheet>

source/xhtml.xsl

-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    xmlns:fo="http://www.w3.org/1999/XSL/Format"   
-	version="1.0">
-    
-    <xsl:import href="../docbook-xsl-ns-1.75.2/xhtml/chunk.xsl" />
-    
-    <xsl:param name="use.extensions">0</xsl:param>
-    <xsl:param name="use.id.as.filename">1</xsl:param>
-    <xsl:param name="html.ext"></xsl:param>
-    <xsl:param name="base.dir">./</xsl:param>
-    <xsl:param name="chunk.fast">1</xsl:param>
-    <xsl:param name="make.valid.html">1</xsl:param>
-    <xsl:param name="section.autolabel">1</xsl:param>
-    <xsl:param name="generate.index" select="1"></xsl:param>
-    <xsl:param name="section.label.includes.component.label">1</xsl:param>
-    <xsl:param name="chunker.output.indent">yes</xsl:param>
-    <xsl:param name="chunker.output.encoding">UTF-8</xsl:param>
-    <xsl:param name="chunk.first.sections">1</xsl:param>
-    <xsl:param name="chunk.tocs.and.lots">0</xsl:param>
-    <xsl:param name="html.extra.head.links">1</xsl:param>
-    <xsl:param name="generate.manifest">0</xsl:param>
-    <xsl:param name="admon.graphics">1</xsl:param>
-    <xsl:param name="admon.style"></xsl:param>
-    <xsl:param name="html.stylesheet">style.css</xsl:param>
-    <xsl:param name="header.rule">0</xsl:param>
-    <xsl:param name="footer.rule">0</xsl:param>
-    <xsl:param name="toc.max.depth">3</xsl:param>
-    
-    <xsl:template name="user.header.navigation">
-        <!-- stuff put here appears before the top navigation area -->
-    </xsl:template>
-    
-    <xsl:template name="user.footer.navigation">
-        <!-- stuff put here appears after the bottom navigation area -->
-        <xsl:element name="div">
-            <xsl:attribute name="class">revinfo</xsl:attribute>
-            <xsl:value-of select="//pubdate[1]"/>
-        </xsl:element>
-    </xsl:template>
-
-</xsl:stylesheet>

tools/highlight.php

     return $matches[1] . $code . $matches[3];
 }
 
-$path = dirname(dirname(__FILE__));
-$iter = new DirectoryIterator("$path/output/manual");
+$path = $_SERVER['argv'][1];
+if (! $argv) {
+    echo "No path given, not highlighting." . PHP_EOL;
+    exit(1);
+} else {
+    echo "Highlighting in path '$path'." . PHP_EOL;
+}
+
+$iter = new DirectoryIterator($path);
 foreach ($iter as $file) {
     if ($file->isFile()) {
         $name = $file->getPathName();