Fundamental to generalized markup is the separation of content from style. It leverages lessons learned that go back to John W. Seybold's work at ROCAPPI, where lookup tables were first used to replace complex and error-prone typesetting markup codes with short — easy to type and differentiate — strings of text.
Figure 6. Typesetting lookup table
Easy strings of text | Confusing, error-prone typesetting codes |
---|---|
"<p> " | ;;; ldasj;fsadlkf dsalkf jdsa;l fjdsl;f dsl;f jdsafldslfkds ld ::: |
"</p> " | ;;; a s;dfkjsadfklds fldskaj fdskf ds;lkf sdlkf dslf sadlfk jdsfkj ds ::: |
In this world, formatting is associated with generalized data structures, making it easy to apply new styles or transforms, as the need arises. For this document, it took a couple of days to:
Add new data structures to prodoc to make authoring easier to match DocBook requirements.
Create a new stylesheet, pdoc2docbook.xsl
, to transform prodoc XML to DocBook XML.
It stripped all of prodoc's attributes, mapped element names from one markup language to the other, and changed the structure of a few branches.
Tune the XML source and XSLT files to create valid DocBook XML.
prodoc structures that couldn't be rendered were converted to images.
Once the pipeline was stable, attention went back to authoring and editing. A handful of whitespace issues required manual cleanup.