How do I print the Example and Syntax sub headings in WebHelp/PDF

Here should go questions about transforming XML with XSLT and FOP.
samuelthomasril
Posts: 2
Joined: Tue Jul 21, 2015 10:04 am

How do I print the Example and Syntax sub headings in WebHelp/PDF

Post by samuelthomasril »

Hi,
I am using the DITA Reference topic. When I use the <refsyn> tag, I see the Syntax heading in the Editor but the heading does not get rendered in the WebHelp or PDF. Same is the case with the Example tag.
Can you please help me print the headings in the Web Help.
Thanks
Samuel
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Post by Frank Ralf »

Hi Samuel,

You can add these labels using CSS. Here's a sample from my WebHelp CSS for task prerequisites:

Code: Select all


div.prereq:before{
content:"Prerequisites: ";
}
See C:\Program Files\Oxygen XML Author 16\frameworks\dita\css_classed\reference.css for sample CSS. And use a tool like Firebug to inspect the WebHelp HTML to see which the corresponding HTML elements are.

See CSS Customizations for instructions how to add your own CSS to the WebHelp.

hth
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Post by Frank Ralf »

PDF customization is a bit more tricky. See DITA to PDF Output Customization for instructions.

Frank
Frank Ralf
parson AG
www.parson-europe.com
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Post by bogdan_cercelaru »

Hello,

The WebHelp output can be styled using a custom CSS file. To see your ""Example" and "Syntax" headers (labels) in the output you should create a custom CSS file that contains styles like the one below:

Code: Select all

div.refsyn:before {
font-weight: bold;
font-style: normal;
display: block;
content: "Syntax: ";
}

div.example:before {
font-weight: bold;
font-style: normal;
display: block;
content: "Example: ";
}
To use the custom CSS file, edit the "DITA Map WebHelp" transformation scenario, switch to the "Parameters" tab and change the "args.css" parameter to point to the file that you created earlier. Also, change the "args.copycss" parameter to "yes" to have the custom CSS file automatically copied to your output.

Let me know if you need any further assistance.

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
GKlimeck
Posts: 23
Joined: Tue Mar 07, 2017 7:54 pm

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Post by GKlimeck »

I have a question related to the discussion in this thread.
For a task document.xml with <stepxmp>...

How do I get the subheading "Example:" to appear in the ouptput pdf from the DITA PDF transformation?
Thank you for your help,
Ginny
GKlimeck
Posts: 23
Joined: Tue Mar 07, 2017 7:54 pm

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Post by GKlimeck »

Using Oxygen 18.0 with DITA-OT 2.x

did not find "Example:" in file:
C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\cfg\common\vars\en.xml

Ginny
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: How do I print the Example and Syntax sub headings in WebHelp/PDF

Post by radu_pisoi »

Hi,

I'm not sure there is any option you can use to generate a label in front of the stepxmp element.

In this case, you need to write a PDF extension plugin to implement this behavior. Instructions about how to create an PDF extension plugin are here:
http://www.dita-ot.org/2.4/dev_ref/pdf- ... ample.html

Details about how to modify or add generated text are presented in the DITA-OT documentation:
http://www.dita-ot.org/2.4/dev_ref/plug ... dtext.html

About the development, a good starting point is to search for the task/stepxmp string in the PDF2 plugin. In this way, you will find the XSLT templates that should be overridden from your customization.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply