Commits

Anonymous committed 0366823

Converted the stylehseets to separate xhtml and fo ones. Added a script
for installation.

  • Participants
  • Parent commits 9f7617f

Comments (0)

Files changed (5)

File share/Install.bash

+#!/bin/bash
+find make sgml -type f | grep -vF .svn | grep -vP '~$' | grep -vP '\.swp$' |
+(while read T; do
+    dir="$HOME/apps/docbook-builder/share/$(dirname "$T")"
+    mkdir -p "$dir"
+    cp -f "$T" "$dir"
+done)

File share/make/main-docbook.mak

 MAIN_SOURCE = $(DOC).xml
 
 
-# Declare the XSLT Stylesheet
+# Declare the XSLT Stylesheets
 
-XSLT_SS = $(DOCMAKE_XSLT_PATH)/shlomif-essays.xsl
+XHTML_XSLT_SS = $(DOCMAKE_XSLT_PATH)/shlomif-essays-xhtml.xsl
 
+FO_XSLT_SS = $(DOCMAKE_XSLT_PATH)/shlomif-essays-fo.xsl
 
 # Declare the PDF and RTF documents.
 
 # HTML.
 
 $(HTML_XSL_TARGET_FILE_IN_DIR): $(XSL_SOURCES)
-	$(XMLTO) --stringparam "docmake.output.format=xhtml" -m $(XSLT_SS) -o $(HTML_XSL_TARGET) xhtml $<
+	$(XMLTO) --stringparam "docmake.output.format=xhtml" -m $(XHTML_XSLT_SS) -o $(HTML_XSL_TARGET) xhtml $<
 
 $(HTML_OTHER_SOURCES_DEST) :: $(HTML_XSL_TARGET)/%: %
 	cp -f $< $@
 # $(PDF_DOC): $(DSSSL_SOURCES)
 #	db2pdf $(DB2_PRINT_FLAGS) $(MAIN_SOURCE)
 $(FO_DOC): $(XSL_SOURCES)
-	$(XMLTO) --stringparam "docmake.output.format=fo" -m $(XSLT_SS) fo $<
+	$(XMLTO) --stringparam "docmake.output.format=fo" -m $(FO_XSLT_SS) fo $<
 
 $(PDF_DOC): $(FO_DOC)
 	fop -fo $< -pdf $@

File share/sgml/docbook-shlomif/xsl-stylesheets/shlomif-essays-fo.xsl

+<xsl:stylesheet
+     version='1.0'
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
+
+    <xsl:import href="shlomif-essays.xsl" />
+
+<!--colored and hyphenated links --> 
+<xsl:template match="ulink"> 
+    <fo:basic-link external-destination="{@url}" 
+         xsl:use-attribute-sets="xref.properties" 
+         text-decoration="underline" 
+         color="blue"> 
+         <xsl:choose> 
+         <xsl:when test="count(child::node())=0"> 
+         <xsl:value-of select="@url"/> 
+         </xsl:when> 
+         <xsl:otherwise> 
+         <xsl:apply-templates/> 
+         </xsl:otherwise> 
+         </xsl:choose> 
+    </fo:basic-link> 
+</xsl:template>
+</xsl:stylesheet>

File share/sgml/docbook-shlomif/xsl-stylesheets/shlomif-essays-xhtml.xsl

+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version='1.0'>
+
+    <xsl:import href="shlomif-essays.xsl" />
+
+<xsl:template match="itemizedlist">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
+    <xsl:call-template name="anchor"/>
+    <xsl:if test="title">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="*[not(self::listitem or self::title 
+        or self::titleabbrev)]"/>
+
+    <ul>
+         <xsl:if test="@role">
+             <xsl:attribute name="class">
+                 <xsl:value-of select="@role"/>
+             </xsl:attribute>
+         </xsl:if>
+
+
+      <xsl:if test="$css.decoration != 0">
+        <xsl:attribute name="type">
+          <xsl:call-template name="list.itemsymbol"/>
+        </xsl:attribute>
+      </xsl:if>
+
+      <xsl:if test="@spacing='compact'">
+        <xsl:attribute name="compact">
+          <xsl:value-of select="@spacing"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates select="listitem"/>
+    </ul>
+  </div>
+</xsl:template>
+
+</xsl:stylesheet>

File share/sgml/docbook-shlomif/xsl-stylesheets/shlomif-essays.xsl

     -->
     <xsl:param name="fop1.extensions">1</xsl:param>
 
-
-<xsl:template match="itemizedlist">
-    <xsl:choose>
-    <xsl:when test="docmake.output.format = 'xhtml'">
-        <xsl:call-template name="html_itemized_list" />
-    </xsl:when>
-    <xsl:otherwise>
-        <xsl:apply-imports />
-    </xsl:otherwise>
-    </xsl:choose>
-</xsl:template>
-
 <xsl:template name="html_itemized_list">
     <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
     <xsl:call-template name="anchor"/>