oxygenxml / dita-ot-css-pdf

Plugin that converts DITA Maps to PDF using CSS 3 stylesheets.
Apache License 2.0
17 stars 8 forks source link

Option for turning off the TOC? #9

Closed markgif closed 8 years ago

markgif commented 8 years ago

I don't see a parameter for turning off the table of contents page. Do you have a suggestion for the simplest way to turn it off?

Thanks, Mark

radu-pisoi commented 8 years ago

There is no parameter that controls whether the table of contents is displayed or not.

You can hide the TOC by setting the display:none property in the CSS file DITA-OT/plugins/com.oxygenxml.pdf.css/css/print/p-toc.css.

*[class ~= "map/map"] > map {
        display: none;
...
}

If you are using the plugin from oXygen, you can also modify the CSS file: oXygenInstallDir/frameworks/dita/css/print/p-toc.css. The CSS files from the oXygenInstallDir/frameworks/dita/css folder are considered more important than the ones from the plugins folder.

Maybe an good idea is to allow an additional CSS file that can be specified as a transformation parameter. This CSS stylesheet can be used to customize the current output.

markgif commented 8 years ago

Great information, thanks. I have used your first suggestion and it worked. I will consider using a transformation parameter when I'm done testing.

I have a question: the selector *[class ~= "map/map"] > map seems to select the opentopic:map element to make it not display. Why does that work even though the opentopic: namespace has not been declared in p-toc.css? I had already tried messing with a namespace to select it.

dan-caprioara commented 8 years ago

Although not in the CSS3 spec, the majority CSS processors and browsers are matching the names from the CSS selectors to the XML elements having that local name, no matter the namespace. So the following are considered equivalent: element{ color: red} *|element{ color: red}