Dita2Kirby (3) - Setting The TXT File Extension
The difficulties in building a plugin dita2kirby.
Kirby is a file-based CMS. It works with text files. So why not create a DITA-OT plugin that generates txt-files made for Kirby CMS?
Two nice H1 headings
After I solved the error message problem due to the
<body>-Tag I now was confronted with two headings. The title of each topic was duplicated. Once the title has been created by the kirby header, and by the XSL-template as well. Without a Kirby header no file will be generated by the CMS at all. It only remained to delete or better to empty the template.
Now I had to search the DITA-OT again. This time after the template that was responsable for the title output. I found in in the dita2htmlImpl.xsl of the xhtml plugin. I copied the template from line 326 and pasted it into my dita2html.xsl file. I emptied the template. This was left:
<xsl:template match= "*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/title ')]"> </xsl:template>
Now the title was generated by the starting title-kirby-tag only. Finally my adopted xsl file looks like this:
Adopting the build file
Now it was time to create a plugin of my own. I copied Jarno´s plugin to another folder and named it to com.ditalog.kirby.txt. Within every file I consistently replaced the string net.sourceforg.dita-ot.html against com.ditalog.kirby.txt. Then I added the folder back into the plugin folder.
In the build file of my new plugin I added a first property:
<property name="out.ext" value=".txt"/>
Again like every plugin I had to integrate it.
ant -f integrator.xml
Still the linking problem was not yet solved.