Adding a step number to a 1-step task
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 167
- Joined: Tue Mar 06, 2018 1:34 am
Adding a step number to a 1-step task
In a DITA task file, if the taskbody > steps has only one STEP element, the resulting web output does not add the "1.".
Even if it's a single step, I still want the "1" to appear in the ::before area of the resulting HTML span. Where can I edit this option?
Even if it's a single step, I still want the "1" to appear in the ::before area of the resulting HTML span. Where can I edit this option?
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Adding a step number to a 1-step task
Hi,
There does not seem to be a publishing parameter for this.
In the XSLT stylesheet "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita.html5/xsl/task.xsl" there is an XML comment:
so that is the place where the decision is made. Probably an HTML customization plugin could override the xsl:template and change it so that it no longer takes this decision.
Regards,
Radu
There does not seem to be a publishing parameter for this.
In the XSLT stylesheet "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita.html5/xsl/task.xsl" there is an XML comment:
Code: Select all
<!-- Single step. Process any stepsection before the step (cannot appear after). -->
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Adding a step number to a 1-step task
Hi,
Hi, I added an improvement request based on what you proposed:
https://github.com/dita-ot/dita-ot/issues/4072
Maybe as a workaround you can match on the generated <div> element for that single step with a custom CSS stylesheet and add a "1." before it:
Regards,
Radu
Hi, I added an improvement request based on what you proposed:
https://github.com/dita-ot/dita-ot/issues/4072
Maybe as a workaround you can match on the generated <div> element for that single step with a custom CSS stylesheet and add a "1." before it:
Code: Select all
div.step:before {
content: "1. ";
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 1
- Joined: Sat Aug 05, 2023 5:50 pm
Re: Adding a step number to a 1-step task
Post by danielsandes »
Hi Radu,
Thanks for the code to add in the custom CSS stylesheet, it worked but I had to do additional customization. That is because the indent (padding) does not match the lists created when there are more than 1 step. This is also true for the child elements, such as <info> and <stepresult>, for those I had to manually add formatting to the CSS stylesheet as they are supposed to differ slightly from the <cmd> as well.
Another thing that I found is that the spacing between the marker 1. and the <cmd> text is not a standard space-character size. I ignored that, but all in all I would agree that it would be beneficial to have this as a transformation scenario option, as feature enhancement. All these small issues could be fixed there as when they are summed up in the CSS stylesheet it starts to get big. And I would want to avoid other elements that are not directly related to this issue being affected as well.
Would it be possible to reconsider the decision made in https://github.com/dita-ot/dita-ot/issues/4072?
Best,
Daniel
Thanks for the code to add in the custom CSS stylesheet, it worked but I had to do additional customization. That is because the indent (padding) does not match the lists created when there are more than 1 step. This is also true for the child elements, such as <info> and <stepresult>, for those I had to manually add formatting to the CSS stylesheet as they are supposed to differ slightly from the <cmd> as well.
Another thing that I found is that the spacing between the marker 1. and the <cmd> text is not a standard space-character size. I ignored that, but all in all I would agree that it would be beneficial to have this as a transformation scenario option, as feature enhancement. All these small issues could be fixed there as when they are summed up in the CSS stylesheet it starts to get big. And I would want to avoid other elements that are not directly related to this issue being affected as well.
Would it be possible to reconsider the decision made in https://github.com/dita-ot/dita-ot/issues/4072?
Best,
Daniel
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Adding a step number to a 1-step task
Hi Daniel,
Maybe you can add a comment on this issue with the problems you mentioned above:
https://github.com/dita-ot/dita-ot/issues/4072
The alternative would be to create your own DITA OT plugin which adds an XSLT stylesheet which overrides from the base "task.xsl" I mentioned in this thread the XSLT template which takes this decision and thus you take full control over what's generated in the HTML for single step tasks.
Regards,
Radu
Maybe you can add a comment on this issue with the problems you mentioned above:
https://github.com/dita-ot/dita-ot/issues/4072
The alternative would be to create your own DITA OT plugin which adds an XSLT stylesheet which overrides from the base "task.xsl" I mentioned in this thread the XSLT template which takes this decision and thus you take full control over what's generated in the HTML for single step tasks.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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