Reuse within codeblocks
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 7
- Joined: Tue Jan 31, 2023 9:24 pm
Reuse within codeblocks
I have a series of questions in a reuse file marked with unique IDs for reuse.
I'm trying to pull various questions from the reuse file into a codeblock in one of my topics. However, the formatting gets messed up. A line break and additional spaces are put in the middle of each reused question in the target file.
Is it possible to use reuse effectively within codeblocks? If not, is there a workaround to achieve the codeblock look with pieces reused from another file? If I put the reused questions as an unordered list in the target file instead of a codeblock, the questions are not broken midstream, but of course, it looks like a bulleted list instead of a code example.
I'm trying to pull various questions from the reuse file into a codeblock in one of my topics. However, the formatting gets messed up. A line break and additional spaces are put in the middle of each reused question in the target file.
Is it possible to use reuse effectively within codeblocks? If not, is there a workaround to achieve the codeblock look with pieces reused from another file? If I put the reused questions as an unordered list in the target file instead of a codeblock, the questions are not broken midstream, but of course, it looks like a bulleted list instead of a code example.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reuse within codeblocks
Hi,
Codeblocks are space preserve so probably what happens is that any content pulled in the codeblock by using conref will contain in the published output exactly the line breaks and formatting they had in the XML content.
This use case of using a codeblock to conref to a list seems kind of strange to me.
Maybe you could achieve what you want using CSS, maybe set an @outputclass attribute with a special value on the <ol> which does the conref:
And then use a custom CSS stylesheet which matches ".questions" and adds specific styling to the ol, maybe a specific background color and a border...
Regards,
Radu
Codeblocks are space preserve so probably what happens is that any content pulled in the codeblock by using conref will contain in the published output exactly the line breaks and formatting they had in the XML content.
This use case of using a codeblock to conref to a list seems kind of strange to me.
Maybe you could achieve what you want using CSS, maybe set an @outputclass attribute with a special value on the <ol> which does the conref:
Code: Select all
<ol outputclass="questions" conref=".....">
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 7
- Joined: Tue Jan 31, 2023 9:24 pm
Re: Reuse within codeblocks
The part I'm pulling in as reuse use has no formatting other than being enclosed in systemoutput elements. No line breaks. These are configuration questions in our software system. We have them in reuse because the wording could change, and we refer to these questions in multiple places in our docs. Sometimes, we have a series of them in a codeblock. Other times, we have just one in a paragraph.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reuse within codeblocks
Hi,
I'm not sure if I understand how things are structured on your side. Maybe you can create a small sample project with a map and 1-2 topics, zip it and send it over (support@oxygenxml.com), then I could try to find some time to look at the samples.
Regards,
Radu
I'm not sure if I understand how things are structured on your side. Maybe you can create a small sample project with a map and 1-2 topics, zip it and send it over (support@oxygenxml.com), then I could try to find some time to look at the samples.
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