Edit online

How to Use a Bullet for Tasks that Contain a Single Step

If a DITA Task document only contains one list item (a single <step> element), you probably want it to be rendered the same as an unordered list (displayed with a bullet instead of a number), as in the following example:
...
<steps>
   <step>
        <cmd>My single step</cmd>
   </step>
</steps>
...
Normally, the output will be rendered as:
  1. The step
instead of:
 o The step
To change the default rendering so that a single step will be rendered with a bullet instead of a number, use an Oxygen Publishing Template and follow these steps:
  1. If you have not already created a Publishing Template, you need to create one. For details, see How to Create a Publishing Template.
  2. Link the folder associated with the publishing template to your current project in the Project view.
  3. Using the Project view, create an xslt folder inside the project root folder.
  4. In the newly created folder, create an XSL file (for example, named merged2html5Extension.xsl) with the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      exclude-result-prefixes="xs"
      version="3.0">
    
      <xsl:template match="*[contains(@class, ' task/step ')][count(../*[contains
    (@class, ' task/step ')]) = 1]">
        <xsl:copy>
          <xsl:copy-of select="@*"/>
          <xsl:attribute name="outputclass" select="concat(@outputclass, ' single ')"/>
          <xsl:apply-templates/>
        </xsl:copy>       
      </xsl:template>
    
    </xsl:stylesheet>
  5. Open the template descriptor file associated with your publishing template (the .opt file) and set the XSLT stylesheet created in the previous step with the com.oxygenxml.pdf.css.xsl.merged2html5 XSLT extension point:
    <publishing-template>
      ...
      <pdf>
        ...        
        <xslt>
          <extension
            id="com.oxygenxml.pdf.css.xsl.merged2html5"
            file="xslt/merged2html5Extension.xsl"/>
        </xslt>
  6. Create a css folder in the publishing template directory. In this directory, save a custom CSS file with rules that style the glossary structure. For example:
    *[outputclass ~= "single"] {
      list-style-type:circle !important;
      margin-left:2em;
    }
  7. Open the template descriptor file associated with your publishing template (the .opt file) and reference your custom CSS file in the resources element:
    <publishing-template>
      ...
      <pdf>
        ...                
        <resources>            
          <css file="css/custom.css"/>
        </resources> 
  8. Edit the DITA Map PDF - based on HTML5 & CSS transformation scenario.
  9. In the Templates tab, click the Choose Custom Publishing Template link and select your template.
  10. Click OK to save the changes and run the transformation scenario.