
doc.scripts.RtfToDtbook.html Maven / Gradle / Ivy
The newest version!
Pipeline Script: RTF to DTBook
Pipeline Script: RTF to DTBook
Overview
This script converts an RTF file to DTBook XML, and then validates the result.
Input Requirements
An RTF file. To ensure correctness of the DTBook output, make sure to follow the RTF authoring guidelines.
Output
A DTBook file, which may or may not be valid - be sure to check the result of the validation pass!
Configuration
- Required. Input RTF file
- Required. Output DTBook file
- Optional. XML Validation Report
- Select a file to store the DTBook validation XML report in. Note that information on the validation result is always shown in the user interface; regardless of whether you activate this option or not.
RTF authoring guidelines
The following mapping between RTF styles and DTBook elements is explicitly supported.
RTF style names appear in bold; opening DTBook tags and attributes in HTML code.
Normal
<p>
Heading 1 through Heading 6
<h1>
through <h6>
, with relevant <levelx>
section wrappers added. Nesting must proceed in natural DTBook order.
Page numbers
<pagenum>
Block Text
<blockquote><p>
Lists
Nesting supported:
-
List Bullet:
<list type="ul">
, <li>
-
List Bullet 2 is second level list, etc.
-
List Number:
<list type="ol">
, <li>
-
List Number 2 is second level list, etc.
- list attributes:
-
enum="1"
: when the first list item marker has an ordinal from 1-9
-
enum="a"
: for initial item markers a-h
-
enum="A"
: for item markers A-H, and their start attributes
-
enum="i"
: for lower case roman numerals
-
enum="I"
: for upper case roman numerals
-
start="[x]"
: for arabic or alphabetic enum types which do not start at "1", "a" or "A".
- list item markers themselves are dropped, given the intention of dtbook to convey these logically.
Tables
Simple tables are supported, using basic <table>
and <tr>
elements.
-
Header:
<th>
-
Normal:
<td>
- column-spanning cells are not tagged as such.
Footnotes
<noteref>
, <note>
- Two types of footnotes are supported: proper Word footnotes, and manual footnotes, using styles Footnote Reference and Footnote Text. The ID attributes assigned are derived from the footnote number, so a document with duplicate footnote numbers will need to be assigned unique IDs in the XML.
Caption
If beside an image, an <imggroup>
is created, with a dummy <img>
tag and <caption>
tag for the text.
Character styles
Page Number
<pagenum>
- Arabic numerals:
page="normal"
- Roman numerals:
page="front"
- Other:
page="special"
- ID attribute: page number prefixed by the letter p, e.g.
id="p12"
italic/underline
<em>
bold
<strong>
superscript
<sup>
subscript
<sub>
HTML Code
<code>
Appendix: List of Transformers used
The documents linked below are parts of the Transformer technical documentation. These are developer and systems-administrator centric documents.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy