adding 2 css stylesheets in DocBook to EPUB
-
- Posts: 37
- Joined: Fri May 20, 2011 6:07 pm
adding 2 css stylesheets in DocBook to EPUB
In order to keep my files simple, I'd like to add 2 stylesheets to my epub (generated from DocBook via the ANT transform). One stylesheet will override a few lines in the much larger second (this keeps me from having to maintain 2 complete stylesheets).
I know how to get my custom stylesheet into the epub in the parameters. Is there a simple way to get a second stylesheet in there as well? Or would this require customizing the build.xml file.
Thanks for any help.
jz
I know how to get my custom stylesheet into the epub in the parameters. Is there a simple way to get a second stylesheet in there as well? Or would this require customizing the build.xml file.
Thanks for any help.
jz
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: adding 2 css stylesheets in DocBook to EPUB
Post by sorin_ristache »
Hi,
Adding a second CSS stylesheet requires the modification of both the build.xml file and an XSLT stylesheet that declares the CSS stylesheet in the manifest.opf file. You can add a custom transformation parameter in the DocBook EPUB scenario called for example html.stylesheet.custom and modify the template called "opf.manifest" in [Oxygen-install-dir]/frameworks/docbook/xsl/epub/docbook.xsl and also add this parameter in [Oxygen-install-dir]/frameworks/docbook/xsl/epub/bin/build.xml.
I suggest keeping the two CSSs in the same directory, importing the first CSS in the second one (using @import), setting the second one in the html.stylesheet parameter and just adding in build.xml an instruction for copying the first one to the output directory of the EPUB transformation (the ${outputDir} variable). The build.xml instruction which you add for copying the CSS stylesheet should copy it in the same sub-directory of ${outputDir} as the other CSS (from the html.stylesheet parameter): if the CSS is located outside the directory of the source XML file the build.xml instruction should copy it in the ${outputDir}/css directory, otherwise the build.xml instruction should keep the relative path of the other CSS stylesheet (for example ${outputDir}/myDir if the other CSS is located in [directory-of-input-XML/myDir).
Regards,
Sorin
Adding a second CSS stylesheet requires the modification of both the build.xml file and an XSLT stylesheet that declares the CSS stylesheet in the manifest.opf file. You can add a custom transformation parameter in the DocBook EPUB scenario called for example html.stylesheet.custom and modify the template called "opf.manifest" in [Oxygen-install-dir]/frameworks/docbook/xsl/epub/docbook.xsl and also add this parameter in [Oxygen-install-dir]/frameworks/docbook/xsl/epub/bin/build.xml.
I suggest keeping the two CSSs in the same directory, importing the first CSS in the second one (using @import), setting the second one in the html.stylesheet parameter and just adding in build.xml an instruction for copying the first one to the output directory of the EPUB transformation (the ${outputDir} variable). The build.xml instruction which you add for copying the CSS stylesheet should copy it in the same sub-directory of ${outputDir} as the other CSS (from the html.stylesheet parameter): if the CSS is located outside the directory of the source XML file the build.xml instruction should copy it in the ${outputDir}/css directory, otherwise the build.xml instruction should keep the relative path of the other CSS stylesheet (for example ${outputDir}/myDir if the other CSS is located in [directory-of-input-XML/myDir).
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service