]> granicus.if.org Git - docbook-dsssl/commitdiff
Added support for Eclipse Help Platform
authorJirka Kosek <jirka@kosek.cz>
Tue, 22 Jul 2003 10:44:08 +0000 (10:44 +0000)
committerJirka Kosek <jirka@kosek.cz>
Tue, 22 Jul 2003 10:44:08 +0000 (10:44 +0000)
xsl/eclipse/eclipse.xsl [new file with mode: 0644]
xsl/html/Makefile.param
xsl/html/param.ent
xsl/html/param.xweb
xsl/params/eclipse.autolabel.xml [new file with mode: 0644]
xsl/params/eclipse.plugin.id.xml [new file with mode: 0644]
xsl/params/eclipse.plugin.name.xml [new file with mode: 0644]
xsl/params/eclipse.plugin.provider.xml [new file with mode: 0644]

diff --git a/xsl/eclipse/eclipse.xsl b/xsl/eclipse/eclipse.xsl
new file mode 100644 (file)
index 0000000..28855a3
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+               version="1.0">
+  
+<xsl:import href="../html/chunk.xsl"/>
+
+<!-- ********************************************************************
+     $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:template match="/">
+  <xsl:choose>
+    <xsl:when test="$rootid != ''">
+      <xsl:choose>
+        <xsl:when test="count(key('id',$rootid)) = 0">
+          <xsl:message terminate="yes">
+            <xsl:text>ID '</xsl:text>
+            <xsl:value-of select="$rootid"/>
+            <xsl:text>' not found in document.</xsl:text>
+          </xsl:message>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>Formatting from <xsl:value-of select="$rootid"/></xsl:message>
+          <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="/" mode="process.root"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:call-template name="etoc"/>
+  <xsl:call-template name="plugin.xml"/>
+
+</xsl:template>
+
+<xsl:template name="etoc">
+  <xsl:call-template name="write.chunk">
+    <xsl:with-param name="filename" select="'toc.xml'"/>
+    <xsl:with-param name="method" select="'xml'"/>
+    <xsl:with-param name="encoding" select="'utf-8'"/>
+    <xsl:with-param name="indent" select="'yes'"/>
+    <xsl:with-param name="content">
+      <xsl:choose>
+
+        <xsl:when test="$rootid != ''">
+          <xsl:variable name="title">
+            <xsl:if test="$eclipse.autolabel=1">
+              <xsl:variable name="label.markup">
+                <xsl:apply-templates select="key('id',$rootid)" mode="label.markup"/>
+              </xsl:variable>
+              <xsl:if test="normalize-space($label.markup)">
+                <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
+              </xsl:if>
+            </xsl:if>
+            <xsl:apply-templates select="key('id',$rootid)" mode="title.markup"/>
+          </xsl:variable>
+          <xsl:variable name="href">
+            <xsl:call-template name="href.target.with.base.dir">
+              <xsl:with-param name="object" select="key('id',$rootid)"/>
+            </xsl:call-template>
+          </xsl:variable>
+          
+          <toc label="{$title}" topic="{$href}">
+            <xsl:apply-templates select="key('id',$rootid)/*" mode="etoc"/>
+          </toc>
+        </xsl:when>
+
+        <xsl:otherwise>
+          <xsl:variable name="title">
+            <xsl:if test="$eclipse.autolabel=1">
+              <xsl:variable name="label.markup">
+                <xsl:apply-templates select="/*" mode="label.markup"/>
+              </xsl:variable>
+              <xsl:if test="normalize-space($label.markup)">
+                <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
+              </xsl:if>
+            </xsl:if>
+            <xsl:apply-templates select="/*" mode="title.markup"/>
+          </xsl:variable>
+          <xsl:variable name="href">
+            <xsl:call-template name="href.target.with.base.dir">
+              <xsl:with-param name="object" select="/"/>
+            </xsl:call-template>
+          </xsl:variable>
+          
+          <toc label="{$title}" topic="{$href}">
+            <xsl:apply-templates select="/*/*" mode="etoc"/>
+          </toc>
+        </xsl:otherwise>
+
+      </xsl:choose>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="book|part|reference|preface|chapter|bibliography|appendix|article|glossary|section|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv|index" mode="etoc">
+  <xsl:variable name="title">
+    <xsl:if test="$eclipse.autolabel=1">
+      <xsl:variable name="label.markup">
+        <xsl:apply-templates select="." mode="label.markup"/>
+      </xsl:variable>
+      <xsl:if test="normalize-space($label.markup)">
+        <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
+      </xsl:if>
+    </xsl:if>
+    <xsl:apply-templates select="." mode="title.markup"/>
+  </xsl:variable>
+
+  <xsl:variable name="href">
+    <xsl:call-template name="href.target.with.base.dir"/>
+  </xsl:variable>
+
+  <topic label="{$title}" href="{$href}">
+    <xsl:apply-templates select="part|reference|preface|chapter|bibliography|appendix|article|glossary|section|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv|index" mode="etoc"/>
+  </topic>
+
+</xsl:template>
+
+<xsl:template match="text()" mode="etoc"/>
+
+<xsl:template name="plugin.xml">
+  <xsl:call-template name="write.chunk">
+    <xsl:with-param name="filename" select="'plugin.xml'"/>
+    <xsl:with-param name="method" select="'xml'"/>
+    <xsl:with-param name="encoding" select="'utf-8'"/>
+    <xsl:with-param name="indent" select="'yes'"/>
+    <xsl:with-param name="content">
+      <plugin name="{$eclipse.plugin.name}"
+        id="{$eclipse.plugin.id}"
+        version="1.0"
+        provider-name="{$eclipse.plugin.provider}">
+
+        <extension point="org.eclipse.help.toc">
+          <toc file="toc.xml" primary="true"/>
+        </extension>
+          
+      </plugin>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+</xsl:stylesheet>
index be2936091506345abd604d35728e4cadaabdbfc0..0990cbcb1b5b3db8ec9ba57c002bd2579b90ead6 100644 (file)
@@ -40,6 +40,7 @@ PARAMS=../params/admon.graphics.xml \
        ../params/css.decoration.xml \
        ../params/current.docid.xml \
        ../params/default.table.width.xml \
+       ../params/draft.mode.xml \
        ../params/draft.watermark.image.xml \
        ../params/ebnf.table.bgcolor.xml \
        ../params/ebnf.table.border.xml \
@@ -234,4 +235,8 @@ PARAMS=../params/admon.graphics.xml \
        ../params/glossentry.show.acronym.xml \
        ../params/xref.with.number.and.title.xml \
        ../params/ebnf.assignment.xml \
-       ../params/ebnf.statement.terminator.xml
+       ../params/ebnf.statement.terminator.xml \
+       ../params/eclipse.autolabel.xml \
+       ../params/eclipse.plugin.name.xml \
+       ../params/eclipse.plugin.id.xml \
+       ../params/eclipse.plugin.provider.xml
index 1358aced69238b604e9faaabe42fc5993cc44851..948f5c4395d72fe2dadb4bd805ae5bf83dab01ce 100644 (file)
 <!ENTITY xref.with.number.and.title SYSTEM "../params/xref.with.number.and.title.xml">
 <!ENTITY ebnf.assignment SYSTEM "../params/ebnf.assignment.xml">
 <!ENTITY ebnf.statement.terminator SYSTEM "../params/ebnf.statement.terminator.xml">
+<!ENTITY eclipse.autolabel SYSTEM "../params/eclipse.autolabel.xml">
+<!ENTITY eclipse.plugin.name SYSTEM "../params/eclipse.plugin.name.xml">
+<!ENTITY eclipse.plugin.id SYSTEM "../params/eclipse.plugin.id.xml">
+<!ENTITY eclipse.plugin.provider SYSTEM "../params/eclipse.plugin.provider.xml">
index e4d8f49b21e363367318dc65b9769fed5bddb0ac..79da2ed9541b52cdcb20543c9610a038605b2959 100644 (file)
@@ -366,6 +366,13 @@ url="http://docbook.sourceforge.net/projects/xsl/doc/tools/profiling.html">http:
 &htmlhelp.only;
 </reference>
 
+<reference><title>Eclipse Help Platform</title>
+&eclipse.autolabel;
+&eclipse.plugin.name;
+&eclipse.plugin.id;
+&eclipse.plugin.provider;
+</reference>
+
 <reference><title>Localization</title>
 &l10n.gentext.language;
 &l10n.gentext.default.language;
@@ -438,6 +445,10 @@ around all these parameters.</para>
 <src:fragref linkend="ebnf.table.border.frag"/>
 <src:fragref linkend="ebnf.assignment.frag"/>
 <src:fragref linkend="ebnf.statement.terminator.frag"/>
+<src:fragref linkend="eclipse.autolabel.frag"/>
+<src:fragref linkend="eclipse.plugin.name.frag"/>
+<src:fragref linkend="eclipse.plugin.id.frag"/>
+<src:fragref linkend="eclipse.plugin.provider.frag"/>
 <src:fragref linkend="emphasis.propagates.style.frag"/>
 <src:fragref linkend="entry.propagates.style.frag"/>
 <src:fragref linkend="firstterm.only.link.frag"/>
diff --git a/xsl/params/eclipse.autolabel.xml b/xsl/params/eclipse.autolabel.xml
new file mode 100644 (file)
index 0000000..480aa37
--- /dev/null
@@ -0,0 +1,23 @@
+<refentry id="eclipse.autolabel">
+<refmeta>
+<refentrytitle>eclipse.autolabel</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>eclipse.autolabel</refname>
+<refpurpose>Should tree-like ToC use autonumbering feature?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='eclipse.autolabel.frag'>
+<xsl:param name="eclipse.autolabel" select="0"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If you want to include chapter and section numbers into ToC in
+the left panel, set this parameter to 1.</para>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/eclipse.plugin.id.xml b/xsl/params/eclipse.plugin.id.xml
new file mode 100644 (file)
index 0000000..11718d7
--- /dev/null
@@ -0,0 +1,23 @@
+<refentry id="eclipse.plugin.id">
+<refmeta>
+<refentrytitle>eclipse.plugin.id</refentrytitle>
+<refmiscinfo role="type">string</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>eclipse.plugin.id</refname>
+<refpurpose>Eclipse Help plugin id</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='eclipse.plugin.id.frag'>
+<xsl:param name="eclipse.plugin.id">com.example.help</xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Eclipse Help plugin id. You should change this id to something
+unique for each help.</para>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/eclipse.plugin.name.xml b/xsl/params/eclipse.plugin.name.xml
new file mode 100644 (file)
index 0000000..f7b10a8
--- /dev/null
@@ -0,0 +1,22 @@
+<refentry id="eclipse.plugin.name">
+<refmeta>
+<refentrytitle>eclipse.plugin.name</refentrytitle>
+<refmiscinfo role="type">string</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>eclipse.plugin.name</refname>
+<refpurpose>Eclipse Help plugin name</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='eclipse.plugin.name.frag'>
+<xsl:param name="eclipse.plugin.name">DocBook Online Help Sample</xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Eclipse Help plugin name.</para>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/eclipse.plugin.provider.xml b/xsl/params/eclipse.plugin.provider.xml
new file mode 100644 (file)
index 0000000..b3156da
--- /dev/null
@@ -0,0 +1,22 @@
+<refentry id="eclipse.plugin.provider">
+<refmeta>
+<refentrytitle>eclipse.plugin.provider</refentrytitle>
+<refmiscinfo role="type">string</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>eclipse.plugin.provider</refname>
+<refpurpose>Eclipse Help plugin provider name</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='eclipse.plugin.provider.frag'>
+<xsl:param name="eclipse.plugin.provider">Example provider</xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Eclipse Help plugin provider name.</para>
+
+</refsect1>
+</refentry>