Write API Guide using DITA

Post here questions and problems related to editing and publishing DITA content.
catherine
Posts: 158
Joined: Fri Nov 10, 2017 8:16 am

Write API Guide using DITA

Post by catherine »

Hi, I am trying to write an API guide using DITA. I find that API guide is quite different from other guides. We have a lot of comands, codes, and references in the guide.
Is there any guideline that I should follow when writing an API guide?

I found this page on your user guide: https://www.oxygenxml.com/dita/1.3/spec ... rence.html

I wonder how to write colorful codes in the

Code: Select all

codeblock
element. and the there is a button at the top-right cornner of the

Code: Select all

codeblock
element that users can copy the codes quickly. How to achieve this?

BTW, how did you make the title style to a grey background, or which element did you use?

Thanks for your any response.
Costin
Posts: 829
Joined: Mon Dec 05, 2011 6:04 pm

Re: Write API Guide using DITA

Post by Costin »

Hi catherine,
I wonder how to write colorful codes in the

Code: Select all

codeblock
For styling purposes, you can use the "outputclass" attribute on the <codeblock/> element. As the @outputclass attrobute specifies the role of an element in the output, you should choose the correct value for it. For <codeblock/> elements for example, content completion offers a number of languages (like "language-xml", "language-java", etc.) which you could use as values for the "@outputclass" attribute, so, depending on the syntax highlight you would need to have in the codeblock, you could choose the appropriate value (language).
You can find more details about the "outputclass" attribute in the DITA Style Guide for Authors.
and the there is a button at the top-right cornner of the

Code: Select all

codeblock
element that users can copy the codes quickly. How to achieve this?
The button is present by default, when code blocks are used.
BTW, how did you make the title style to a grey background, or which element did you use?
To achieve a similar styling with grey background, you could use the <codeph> element.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Post Reply