How to add author information in generated webhelp
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 158
- Joined: Fri Nov 10, 2017 8:16 am
How to add author information in generated webhelp
Hi,
I found this page has author information (including author name, date and time) under the topic title.
https://blog.oxygenxml.com/topics/all_a ... _ons.html
"Contributed by: Radu Coravu on 2020-01-18"
How we can achieve this by Oxygen XML Editor.
Thanks.
Catherine
Best Regards
I found this page has author information (including author name, date and time) under the topic title.
https://blog.oxygenxml.com/topics/all_a ... _ons.html
"Contributed by: Radu Coravu on 2020-01-18"
How we can achieve this by Oxygen XML Editor.
Thanks.
Catherine
Best Regards
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to add author information in generated webhelp
Hi Catherine,
The first side to this is to add the author name and modification time to the DITA topic when I create it:
For the Oxygen XML Blog I have a Schematron schema which reminds me to do that and a quick fix to quickly add this information to a newly created topic:
https://github.com/oxygenxml/blog/blob/ ... /rules.sch
Now for displaying this information in the WebHelp output, I'm using a publishing template which you can download from here, it's a zip file:
https://github.com/oxygenxml/blog/tree/ ... publishing
I pass a reference to this publishing template as a parameter to the WebHelp Responsive transformation:
https://github.com/oxygenxml/blog/blob/ ... roject.xml
More about publishing templates:
https://www.oxygenxml.com/doc/versions/ ... tents.html
Inside the "Oxygen XML Blog WebHelp Template.opt" from the zip I add a custom XSLT extension:
which matches the DITA prolog element and generates an HTML <div> from it:
Regards,
Radu
The first side to this is to add the author name and modification time to the DITA topic when I create it:
Code: Select all
topic id="welcome">
<title>Welcome to the <ph keyref="oxygen"/> Blog !</title>
<prolog>
<author>Radu Coravu</author>
<copyright>
<copyryear year="2020"/>
<copyrholder>Syncro Soft</copyrholder>
</copyright>
<critdates>
<created date="2020-01-14"/>
</critdates>
https://github.com/oxygenxml/blog/blob/ ... /rules.sch
Now for displaying this information in the WebHelp output, I'm using a publishing template which you can download from here, it's a zip file:
https://github.com/oxygenxml/blog/tree/ ... publishing
I pass a reference to this publishing template as a parameter to the WebHelp Responsive transformation:
https://github.com/oxygenxml/blog/blob/ ... roject.xml
More about publishing templates:
https://www.oxygenxml.com/doc/versions/ ... tents.html
Inside the "Oxygen XML Blog WebHelp Template.opt" from the zip I add a custom XSLT extension:
Code: Select all
<extension file="xslt/prolog-show.xsl" id="com.oxygenxml.webhelp.xsl.dita2webhelp"/>
Code: Select all
<xsl:template match="*[contains(@class, ' topic/prolog ')]">
<div style="width:100%; text-align: right; font-style:italic; color:gray;">Contributed by: <xsl:value-of select="*[contains(@class, ' topic/author ')]"/>
<xsl:if test="exists(.//*[contains(@class, ' topic/created ')]/@date)">
on <xsl:value-of select=".//*[contains(@class, ' topic/created ')]/@date"/>
</xsl:if>
</div>
</xsl:template>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: How to add author information in generated webhelp
Post by chrispitude »
Hi catherine,
I recall there is also an Oxygen plugin that automates the creation/updating of this metadata:
https://github.com/oxygenxml/oxygen-dita-prolog-updater
I recall there is also an Oxygen plugin that automates the creation/updating of this metadata:
https://github.com/oxygenxml/oxygen-dita-prolog-updater
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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