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

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

Tue Jul 21, 2015 10:48 am

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: 338
Location: Hamburg

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

Fri Jul 31, 2015 5:42 pm

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: 338
Location: Hamburg

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

Fri Jul 31, 2015 5:45 pm

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: 188

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

Mon Aug 03, 2015 8:36 am

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: 14

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

Tue May 09, 2017 12:41 am

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: 14

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

Tue May 09, 2017 10:04 pm

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: 302
Location: Craiova

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

Wed May 10, 2017 10:00 pm

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

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest