Bård Peter T. wrote:
We have been asked to include the chapter numbers in the table of contents (left pane) of the webhelp version of the documentation.

I cannot figure out how to do this without manually writing the chapter number as part of the titles.

We are using XMLmind, DocBook 5 and webhelp output.

I'm sorry but this is currently not possible when converting DocBook documents to Web Help.

For DITA documents (and also XHTML5+CSS based ebooks, http://www.xmlmind.com/ebookc/; that is, when it's 100% our own work), it works without doing anything special. See for example, "XMLmind DITA Converter Manual", simple layout Web Help, https://www.xmlmind.com/ditac/_distrib/doc/manual/webhelp2/index.html

For DocBook documents, by default, all parts, chapters and sections are automatically numbered but, by design of the Web Help generation pipeline, there is no way to get these automatic numbers when generating the Web Help TOC.

For now, all you can have is something like this:
"XMLmind XML Editor - Configuration and Deployment", "Chapter 1. Introduction", https://www.xmlmind.com/xmleditor/_distrib/doc/configure/wh/introduction.html

Of course, if we find a way to improve this, we'll do it.

-----------------
Technical details
-----------------
The following XSL stylesheet is invoked at the very beginning of Web Help generation pipeline in order to generate the Web Help TOC and Index:

XXE_install_dir/addon/config/docbook5/xsl/webhelp/webhelp.xsl
---
...
<xsl:template match="db:section" mode="whtoc">
  <xsl:variable name="title">
    <xsl:apply-templates select="." mode="title.markup"/>
  </xsl:variable>

  <whc:entry>
    <xsl:attribute name="href">
      <xsl:call-template name="href.target.uri"/>
    </xsl:attribute>

    <whc:title><xsl:value-of select="normalize-space($title)"/></whc:title>

    <xsl:apply-templates select="db:section" mode="whtoc"/>
  </whc:entry>
</xsl:template>
...
---

where mode="title.markup" implementation is found in XXE_install_dir/addon/config/docbook5/xsl/common/titles.xsl:
---
<xsl:template match="d:section
                     |d:sect1|d:sect2|d:sect3|d:sect4|d:sect5
                     |d:refsect1|d:refsect2|d:refsect3|d:refsection
                     |d:topic
                     |d:simplesect"
              mode="title.markup">
  <xsl:param name="allow-anchors" select="0"/>
  <xsl:variable name="title" select="(d:info/d:title
                                      |d:sectioninfo/d:title
                                      |d:sect1info/d:title
                                      |d:sect2info/d:title
                                      |d:sect3info/d:title
                                      |d:sect4info/d:title
                                      |d:sect5info/d:title
                                      |d:refsect1info/d:title
                                      |d:refsect2info/d:title
                                      |d:refsect3info/d:title
                                      |d:refsectioninfo/d:title
                                      |d:title)[1]"/>

  <xsl:apply-templates select="$title" mode="title.markup">
    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  </xsl:apply-templates>
</xsl:template>
---




---
PS: Following your suggestions, the MathML rendering when converting DocBook documents has been improved in (to be released) version 10.6:
---
Enhancements:

- MathML tool: added more <mfenced> elements to the "Bracket pair with separator" section of the "Brackets & Boxes" palette to encourage the use of this element. Something like <mfenced close="]" open="["><mi>x</mi></mfenced> should be simply a convenient notation, strictly equivalent to <mrow><mo>[</mo><mi>x</mi><mo>]</mo></mrow>, but is not in terms of rendering. For some reasons, <mfenced> is rendered to HTML, PDF, etc, by the JEuclid image toolkit plug-in more nicely than <mrow><mo>.

For this reason too, Parse Text As MathML now parses "(x)" as <mfenced><mi>x</mi></mfenced>. Previously, this facility parsed "(x)" as <mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow>.

- When converting a DocBook 4 or 5 document to any HTML-based format (except HTMLHelp), embedded MathML elements and image elements referencing a MathML file (.mml file) are converted to SVG graphics. In previous versions, these elements where converted to PNG images.
---


--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to