]> granicus.if.org Git - apache/commitdiff
Add the parts for the xml to html transformation system for the module
authorJoshua Slive <slive@apache.org>
Thu, 14 Feb 2002 00:48:04 +0000 (00:48 +0000)
committerJoshua Slive <slive@apache.org>
Thu, 14 Feb 2002 00:48:04 +0000 (00:48 +0000)
docs.  Details will be at
http://httpd.apache.org/docs-project/docsformat.html
shortly.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93398 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/build.sh [new file with mode: 0644]
docs/manual/style/build.xml [new file with mode: 0644]
docs/manual/style/manual.xsl [new file with mode: 0644]

diff --git a/docs/manual/style/build.sh b/docs/manual/style/build.sh
new file mode 100644 (file)
index 0000000..f1b777c
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ "$JAVA_HOME" = "" ] ; then
+  echo You must set JAVA_HOME to point at your Java Development Kit directory
+  exit 1
+fi
+
+# convert the existing path to unix
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+   CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# Add in your .jar files first
+for i in ./lib/*.jar
+do
+    CLASSPATH=$CLASSPATH:"$i"
+done
+
+# convert the unix path to windows
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+   CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+fi
+
+BUILDFILE=build.xml
+
+${JAVA_HOME}/bin/java $ANT_OPTS -classpath "$CLASSPATH" \
+                org.apache.tools.ant.Main \
+                -Dant.home=$ANT_HOME \
+                -buildfile ${BUILDFILE} \
+                 "$@"
diff --git a/docs/manual/style/build.xml b/docs/manual/style/build.xml
new file mode 100644 (file)
index 0000000..60d4106
--- /dev/null
@@ -0,0 +1,29 @@
+<project name="manual" default="xslt" basedir=".">
+
+    <!-- Initialization properties -->
+    <path id="classpath">
+        <fileset dir="./lib">
+            <include name="**/*.jar"/>
+        </fileset>
+    </path>
+
+
+<!-- This target is for output of HTML pages via XSLT -->
+  <!-- Requires JAXP/1.1 (all three JARs) or Xerces+Xalan -->
+  <target name="xslt"
+   description="Render HTML Pages via XSLT">
+
+    <!-- Transform the modules directory -->
+    <style   basedir="../mod/"
+             destdir="../mod/"
+           extension=".html"
+               style="./manual.xsl"
+            excludes="empty.xml"
+            includes="*.xml">
+      <param name="relative-path" expression="."/>
+    </style>
+  </target>
+
+
+
+</project>
diff --git a/docs/manual/style/manual.xsl b/docs/manual/style/manual.xsl
new file mode 100644 (file)
index 0000000..6b7c188
--- /dev/null
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0">
+
+  <!-- Output method -->
+  <xsl:output method="html"
+            encoding="iso-8859-1"
+              indent="yes"/>
+
+
+  <!-- Defined parameters (overrideable) -->
+  <xsl:param    name="relative-path" select="'.'"/>
+
+  <!-- Process an entire document into an HTML page -->
+  <xsl:template match="modulesynopsis">
+
+    <html>
+    <head>
+    <xsl:apply-templates select="meta"/>
+    <title><xsl:value-of select="name"/> - Apache HTTP Server</title>
+    </head>
+    <body>
+
+<blockquote>
+
+    <div align="center">
+      <img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]" /> 
+      <h3>Apache HTTP Server Version 2.0</h3>
+    </div>
+    <h1 align="center">Apache Module <xsl:value-of select="name"/></h1>
+
+<!-- Description and module-headers -->
+
+
+<table bgcolor="#cccccc" cellpadding="0" cellspacing="1">
+<tr><td>
+<table bgcolor="#ffffff">
+<tr><td><strong>Description:</strong> </td>
+<td><xsl:apply-templates select="description"/></td></tr>
+<tr><td><a class="help" href="module-dict.html#Status"><strong>Status:</strong></a> </td>
+<td><xsl:value-of select="status"/></td></tr>
+<tr><td><a class="help" href="module-dict.html#ModuleIdentifier"><strong>Module Identifier:</strong></a> </td>
+<td><xsl:value-of select="identifier"/></td></tr>
+<tr><td><a class="help" href="module-dict.html#Compatibility"><strong>Compatibility:</strong></a> </td>
+<td><xsl:apply-templates select="compatibility"/></td></tr>
+</table>
+</td></tr>
+</table>
+
+
+<h2>Summary</h2>
+<xsl:apply-templates select="summary"/>
+
+<xsl:if test="seealso">
+<p><strong>See also:</strong></p>
+<ul>
+  <xsl:for-each select="seealso">
+    <li><xsl:apply-templates/></li>
+  </xsl:for-each>
+</ul>
+</xsl:if>
+
+<h2>Directives</h2>
+
+<ul>
+ <xsl:for-each select="directivesynopsis/name">
+  <xsl:sort select="name"/>
+  <xsl:variable name="name">
+   <xsl:value-of select="."/>
+  </xsl:variable>
+  <li><a href="#{$name}"><xsl:value-of select="."/></a></li>
+ </xsl:for-each>
+</ul>
+
+<xsl:apply-templates select="section"/>
+
+<hr />
+
+<xsl:apply-templates select="directivesynopsis">
+  <xsl:sort select="name"/>
+</xsl:apply-templates> 
+
+    <h3 align="center">Apache HTTP Server Version 2.0</h3>
+    <a href="./"><img src="../images/index.gif" alt="Index" /></a>
+    <a href="../"><img src="../images/home.gif" alt="Home" /></a>
+
+</blockquote>
+
+    </body>
+    </html>
+  </xsl:template>
+
+<!-- Process a documentation section -->
+  <xsl:template match="section">
+    <xsl:variable name="href">
+      <xsl:value-of select="@id"/>
+    </xsl:variable>
+      <!-- Section heading -->
+    <xsl:if test="@id">
+      <h2><a name="{$href}"><xsl:apply-templates select="./title" mode="print"/></a></h2>
+    </xsl:if>
+    <xsl:if test="not(@id)">
+      <h2><xsl:apply-templates select="./title" mode="print"/></h2>
+    </xsl:if>
+      <!-- Section body -->
+        <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="section/title" mode="print">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- Don't print the title twice -->
+  <xsl:template match="section/title"></xsl:template>
+
+  <xsl:template match="directivesynopsis">
+  <xsl:variable name="name">
+   <xsl:value-of select="./name"/>
+  </xsl:variable>
+
+    <h2><a name="{$name}"><xsl:value-of select="./name"/> Directive</a></h2>
+<table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1">
+<tr><td>
+<table bgcolor="#ffffff" width="100%">
+<tr><td><strong>Description:</strong> </td>
+<td><xsl:value-of select="description"/></td></tr>
+<tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a> </td>
+<td><xsl:apply-templates select="syntax"/></td></tr>
+<tr><td><a class="help" href="directive-dict.html#Default">Default:</a> </td>
+<td><code><xsl:value-of select="default"/></code></td></tr>
+<tr><td><a class="help" href="directive-dict.html#Context">Context:</a> </td>
+<td><xsl:value-of select="context"/></td></tr>
+<tr><td><a class="help" href="directive-dict.html#Override">Override:</a> </td>
+<td><xsl:value-of select="override"/></td></tr>
+<tr><td><a class="help" href="directive-dict.html#Status">Status:</a> </td>
+<td><xsl:value-of select="/modulesynopsis/status"/></td></tr>
+<tr><td><a class="help" href="directive-dict.html#Module">Module:</a> </td>
+<td><xsl:value-of select="/modulesynopsis/name"/></td></tr>
+<tr><td><a class="help" href="directive-dict.html#Compatibility">Compatibility:</a> </td>
+<td><xsl:value-of select="compatibility"/></td></tr>
+</table>
+</td></tr></table>
+<xsl:apply-templates select="usage"/>
+
+<xsl:if test="seealso">
+<p><strong>See also:</strong></p>
+<ul>
+  <xsl:for-each select="seealso">
+    <li><xsl:apply-templates/></li>
+  </xsl:for-each>
+</ul>
+</xsl:if>
+
+<hr />
+</xsl:template>
+
+  <xsl:template match="example">
+  <blockquote>
+  <table cellpadding="10"><tr><td bgcolor="#eeeeee">
+     <xsl:apply-templates select="title" mode="print"/>
+     <code><xsl:apply-templates/></code>
+  </td></tr></table>
+  </blockquote>
+  </xsl:template>
+
+  <xsl:template match="example/title" mode="print">
+     <p align="center"><strong><xsl:apply-templates/></strong></p>
+  </xsl:template>
+  <xsl:template match="example/title"></xsl:template>
+
+  <xsl:template match="note">
+  <blockquote>
+  <table><tr><td bgcolor="#ffffcc">
+     <xsl:apply-templates/>
+  </td></tr></table>
+  </blockquote>
+  </xsl:template>
+  <xsl:template match="note/title">
+     <p align="center"><strong><xsl:apply-templates/></strong></p>
+  </xsl:template>
+
+  <xsl:template match="directive">
+    <code>
+    <xsl:if test="@module">
+      <xsl:variable name="module">
+        <xsl:value-of select="./@module"/>
+      </xsl:variable>
+      <xsl:variable name="directive">
+        <xsl:value-of select="."/>
+      </xsl:variable>
+      <xsl:if test="@module=/modulesynopsis/name">
+        <a href="#{$directive}"><xsl:value-of select="."/></a>
+      </xsl:if>
+      <xsl:if test="@module!=/modulesynopsis/name">
+        <a href="{$module}.html#{$directive}"><xsl:value-of select="."/></a>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="not(@module)">
+       <xsl:value-of select="."/>
+    </xsl:if>
+    </code>
+  </xsl:template>
+
+  <xsl:template match="module">
+    <code>
+    <xsl:variable name="href">
+      <xsl:value-of select="."/>
+    </xsl:variable>
+    <a href="{$href}.html"><xsl:value-of select="."/></a>
+    </code>
+  </xsl:template>
+
+  <!-- Process everything else by just passing it through -->
+  <xsl:template match="*|@*">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|*|text()"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>