Extended CSS Plug-in
This is an abstract base DITA-OT Plug-in to extend HTML processing and allow
additional plug-ins to add an extra CSS stylesheet to the <header>
of each HTML page. By default the plug-in does nothing apart from creating a
temporary file extend.css.file
- it is designed to be extended
so other plugins can add CSS to the blank file.
It offers three extension-points for further CSS processing.
Install
This is a standalone plug-in without dependencies which can be installed from the command line.
Run the plug-in installation commands:
dita install https://github.com/jason-fox/jason.fox.extend.css/archive/master.zip
The dita command line tool requires no additional configuration.
Usage
Run any HTML dita transform e.g.:
dita --format html5 --output out --input document.ditamap
Each HTML output file will include an additional line in the <head>
.
The file common-extended.css
will include any CSS added via the
extension points described below.
Extension points
CSS rules are always position dependent - the rule defined last in a file will supersede previous definitions. This plug-in is offers three extension points where CSS can be appended to a file so that CSS rules can be added in order.
- extend.css.process.pre - Runs an additional ANT target before the extended css processing stage.
- extend.css.process - Runs an additional ANT target as part of the extended css processing stage.
- extend.css.process.post - Runs an additional ANT target after the extended css processing.
Example
The following plugin.xml
will invoke an extension point and
append additional CSS to extend.css.file
which is copied to
the output
Working examples can be found in the DITA-OT Swagger plug-in and DITA-OT Prism-JS plug-in repositories.