grim/purple-objects-docbook

moved all of the stylesheets to sheets/

2009-04-17, Gary Kramlich
2b9a5fd42173
Parents 98abf6734d6a
Children 5e2042823009
moved all of the stylesheets to sheets/
updated Makefile to create images from dot input thats created by the new stylesheets
--- a/Makefile Fri Apr 17 22:55:04 2009 -0500
+++ b/Makefile Fri Apr 17 23:03:55 2009 -0500
@@ -1,9 +1,13 @@
TRANSFORM=xsltproc
TRANSFORM_OPTS=--nonet --xinclude
-SHEET=purple-objects.xsl
OUTPUT=html/
BOOK=purple-objects.xml
+SHEETS=\
+ sheets/class.xsl \
+ sheets/enum.xsl \
+ sheets/purple-objects.xsl
+
BOOK_SOURCES=\
about.xml \
graphs.xml \
@@ -12,12 +16,13 @@
IMAGES=\
object-key.png \
- plugin-class.png \
+ plugin.png \
plugin-objects.png \
plugin-loader-objects.png \
+ plugin-state.png \
relationship-key.png
-all: book.stamp images.stamp
+all: book.stamp images.stamp $(SHEETS)
%.png: %.fdp
fdp -Tpng -o $(OUTPUT)$@ $<
@@ -25,8 +30,14 @@
%.png: %.dot
dot -Tpng -o $(OUTPUT)$@ $<
-book.stamp: $(BOOK_SOURCES) $(SHEET)
- $(TRANSFORM) $(TRANSFORM_OPTS) -o $(OUTPUT) $(SHEET) $(BOOK)
+%.dot: %.enum
+ $(TRANSFORM) $(TRANSFORM_OPTS) -o $@ sheets/enum.xsl $<
+
+%.dot: %.class
+ $(TRANSFORM) $(TRANSFORM_OPTS) -o $@ sheets/class.xsl $<
+
+book.stamp: $(BOOK_SOURCES) sheets/purple-objects.xsl
+ $(TRANSFORM) $(TRANSFORM_OPTS) -o $(OUTPUT) sheets/purple-objects.xsl $(BOOK)
touch spec.stamp
images.stamp: $(IMAGES)
--- a/class.xsl Fri Apr 17 22:55:04 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text"/>
-
- <xsl:strip-space elements="*"/>
-
- <!-- variables -->
- <xsl:variable name="newline" select="'&#10;'"/>
- <xsl:variable name="tab" select="'&#9;'"/>
-
- <xsl:variable name="newline-tab">
- <xsl:value-of select="$newline"/>
- <xsl:value-of select="$tab"/>
- </xsl:variable>
-
- <!-- scope template -->
- <xsl:template name="scope">
- <xsl:choose>
- <xsl:when test="@scope = 'private'">
- <xsl:text>-</xsl:text>
- </xsl:when>
- <xsl:when test="@scope = 'public'">
- <xsl:text>+</xsl:text>
- </xsl:when>
- <xsl:when test="@scope = 'protected'">
- <xsl:text>#</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- the actual matching -->
- <xsl:template match="class">
- <!-- start the diagram -->
- <xsl:text>digraph {</xsl:text>
- <xsl:value-of select="$newline-tab"/>
-
- <!-- set our node settings -->
- <xsl:text>node[fontname="sans", fontsize="9", shape="record", style="filled", fillcolor="lightyellow"];</xsl:text>
- <xsl:value-of select="$newline-tab"/>
-
- <!-- handle the beginning of the class node -->
- <xsl:text>class[label="{</xsl:text>
- <xsl:value-of select="@name"/>
-
- <!-- if the class is abstract, mark it as such -->
- <xsl:if test="@abstract">
- <xsl:text>\n\&lt;\&lt; abstract \&gt;\&gt;</xsl:text>
- </xsl:if>
-
- <xsl:text>|</xsl:text>
-
- <!-- run through the properties -->
- <xsl:for-each select="properties/property">
- <xsl:call-template name="scope"/>
-
- <!-- now the rest of the property -->
- <xsl:text> </xsl:text>
- <xsl:value-of select="@name"/>
-
- <xsl:if test="@type">
- <xsl:text> : </xsl:text>
- <xsl:value-of select="@type"/>
- </xsl:if>
-
- <xsl:text>\l</xsl:text>
- </xsl:for-each>
-
- <xsl:text>|</xsl:text>
-
- <!-- run through the methods -->
- <xsl:for-each select="methods/method">
- <xsl:call-template name="scope"/>
-
- <!-- start the method -->
- <xsl:text> </xsl:text>
- <xsl:value-of select="@name"/>
-
- <!-- start the arguments -->
- <xsl:text>(</xsl:text>
-
- <!-- run through the arguments -->
- <xsl:for-each select="argument">
- <!-- put a comment at the end of the last text if this isn't
- the first argument.
- -->
- <xsl:if test="position() &gt; 1">
- <xsl:text>, </xsl:text>
- </xsl:if>
-
- <xsl:value-of select="@name"/>
-
- <xsl:if test="@type">
- <xsl:text> : </xsl:text>
- <xsl:value-of select="@type"/>
- </xsl:if>
- </xsl:for-each>
-
- <!-- finish the arguments -->
- <xsl:text>)</xsl:text>
-
- <xsl:text>\l</xsl:text>
- </xsl:for-each>
-
- <!-- finish off the class node -->
- <xsl:text>}"];</xsl:text>
-
- <!-- finish up -->
- <xsl:value-of select="$newline"/>
- <xsl:text>}</xsl:text>
- <xsl:value-of select="$newline"/>
- </xsl:template>
-</xsl:stylesheet>
--- a/enum.xsl Fri Apr 17 22:55:04 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text"/>
-
- <xsl:strip-space elements="*"/>
-
- <!-- variables -->
- <xsl:variable name="newline" select="'&#10;'"/>
- <xsl:variable name="tab" select="'&#9;'"/>
-
- <xsl:variable name="newline-tab">
- <xsl:value-of select="$newline"/>
- <xsl:value-of select="$tab"/>
- </xsl:variable>
-
- <xsl:template match="enumeration">
- <!-- start the diagram -->
- <xsl:text>digraph {</xsl:text>
- <xsl:value-of select="$newline-tab"/>
-
- <!-- set our node settings -->
- <xsl:text>node[fontname="sans", fontsize="9", shape="record", style="filled", fillcolor="lightyellow"];</xsl:text>
- <xsl:value-of select="$newline-tab"/>
-
- <!-- handle the beginning of the enum node -->
- <xsl:text>enum[label="{</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>\n\&lt;\&lt; enumeration \&gt;\&gt;</xsl:text>
-
- <!-- run through all the items -->
- <xsl:for-each select="item">
- <xsl:text>|</xsl:text>
- <xsl:value-of select="@name"/>
-
- <!-- check if we have a value and output it -->
- <xsl:if test="@value">
- <xsl:text> : </xsl:text>
- <xsl:value-of select="@value"/>
- </xsl:if>
-
- <!-- left align the item -->
- <xsl:text>\l</xsl:text>
- </xsl:for-each>
-
- <!-- finish off the enum node -->
- <xsl:text>}"];</xsl:text>
-
- <!-- finish up -->
- <xsl:value-of select="$newline"/>
- <xsl:text>}</xsl:text>
- <xsl:value-of select="$newline"/>
- </xsl:template>
-</xsl:stylesheet>
--- a/purple-objects.xsl Fri Apr 17 22:55:04 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
- <!-- import the chunked XSL stylesheet -->
- <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
-
- <!-- change some parameters -->
- <xsl:param name="chunker.ouput.indent" select="'yes'"/>
- <xsl:param name="html.ext" select="'.html'"/>
- <xsl:param name="refentry.generate.name" select="0"/>
- <xsl:param name="refentry.generate.title" select="1"/>
- <xsl:param name="use.id.as.filename" select="1"/>
-</xsl:stylesheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sheets/class.xsl Fri Apr 17 23:03:55 2009 -0500
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+
+ <xsl:strip-space elements="*"/>
+
+ <!-- variables -->
+ <xsl:variable name="newline" select="'&#10;'"/>
+ <xsl:variable name="tab" select="'&#9;'"/>
+
+ <xsl:variable name="newline-tab">
+ <xsl:value-of select="$newline"/>
+ <xsl:value-of select="$tab"/>
+ </xsl:variable>
+
+ <!-- scope template -->
+ <xsl:template name="scope">
+ <xsl:choose>
+ <xsl:when test="@scope = 'private'">
+ <xsl:text>-</xsl:text>
+ </xsl:when>
+ <xsl:when test="@scope = 'public'">
+ <xsl:text>+</xsl:text>
+ </xsl:when>
+ <xsl:when test="@scope = 'protected'">
+ <xsl:text>#</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- the actual matching -->
+ <xsl:template match="class">
+ <!-- start the diagram -->
+ <xsl:text>digraph {</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+
+ <!-- set our node settings -->
+ <xsl:text>node[fontname="sans", fontsize="9", shape="record", style="filled", fillcolor="lightyellow"];</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+
+ <!-- handle the beginning of the class node -->
+ <xsl:text>class[label="{</xsl:text>
+ <xsl:value-of select="@name"/>
+
+ <!-- if the class is abstract, mark it as such -->
+ <xsl:if test="@abstract">
+ <xsl:text>\n\&lt;\&lt; abstract \&gt;\&gt;</xsl:text>
+ </xsl:if>
+
+ <xsl:text>|</xsl:text>
+
+ <!-- run through the properties -->
+ <xsl:for-each select="properties/property">
+ <xsl:call-template name="scope"/>
+
+ <!-- now the rest of the property -->
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+
+ <xsl:if test="@type">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="@type"/>
+ </xsl:if>
+
+ <xsl:text>\l</xsl:text>
+ </xsl:for-each>
+
+ <xsl:text>|</xsl:text>
+
+ <!-- run through the methods -->
+ <xsl:for-each select="methods/method">
+ <xsl:call-template name="scope"/>
+
+ <!-- start the method -->
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+
+ <!-- start the arguments -->
+ <xsl:text>(</xsl:text>
+
+ <!-- run through the arguments -->
+ <xsl:for-each select="argument">
+ <!-- put a comment at the end of the last text if this isn't
+ the first argument.
+ -->
+ <xsl:if test="position() &gt; 1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+
+ <xsl:value-of select="@name"/>
+
+ <xsl:if test="@type">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="@type"/>
+ </xsl:if>
+ </xsl:for-each>
+
+ <!-- finish the arguments -->
+ <xsl:text>)</xsl:text>
+
+ <xsl:text>\l</xsl:text>
+ </xsl:for-each>
+
+ <!-- finish off the class node -->
+ <xsl:text>}"];</xsl:text>
+
+ <!-- finish up -->
+ <xsl:value-of select="$newline"/>
+ <xsl:text>}</xsl:text>
+ <xsl:value-of select="$newline"/>
+ </xsl:template>
+</xsl:stylesheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sheets/enum.xsl Fri Apr 17 23:03:55 2009 -0500
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+
+ <xsl:strip-space elements="*"/>
+
+ <!-- variables -->
+ <xsl:variable name="newline" select="'&#10;'"/>
+ <xsl:variable name="tab" select="'&#9;'"/>
+
+ <xsl:variable name="newline-tab">
+ <xsl:value-of select="$newline"/>
+ <xsl:value-of select="$tab"/>
+ </xsl:variable>
+
+ <xsl:template match="enumeration">
+ <!-- start the diagram -->
+ <xsl:text>digraph {</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+
+ <!-- set our node settings -->
+ <xsl:text>node[fontname="sans", fontsize="9", shape="record", style="filled", fillcolor="lightyellow"];</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+
+ <!-- handle the beginning of the enum node -->
+ <xsl:text>enum[label="{</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>\n\&lt;\&lt; enumeration \&gt;\&gt;</xsl:text>
+
+ <!-- run through all the items -->
+ <xsl:for-each select="item">
+ <xsl:text>|</xsl:text>
+ <xsl:value-of select="@name"/>
+
+ <!-- check if we have a value and output it -->
+ <xsl:if test="@value">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="@value"/>
+ </xsl:if>
+
+ <!-- left align the item -->
+ <xsl:text>\l</xsl:text>
+ </xsl:for-each>
+
+ <!-- finish off the enum node -->
+ <xsl:text>}"];</xsl:text>
+
+ <!-- finish up -->
+ <xsl:value-of select="$newline"/>
+ <xsl:text>}</xsl:text>
+ <xsl:value-of select="$newline"/>
+ </xsl:template>
+</xsl:stylesheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sheets/purple-objects.xsl Fri Apr 17 23:03:55 2009 -0500
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <!-- import the chunked XSL stylesheet -->
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
+
+ <!-- change some parameters -->
+ <xsl:param name="chunker.ouput.indent" select="'yes'"/>
+ <xsl:param name="html.ext" select="'.html'"/>
+ <xsl:param name="refentry.generate.name" select="0"/>
+ <xsl:param name="refentry.generate.title" select="1"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+</xsl:stylesheet>