Exclude mini-toc from a chapter based on output class and wrong links formating
-
elisabete reis
- Posts: 10
- Joined: Thu Mar 10, 2022 6:07 pm
Exclude mini-toc from a chapter based on output class and wrong links formating
Post by elisabete reis »
I need to have mini-toc in some chapters but not all. I have tried several approaches with no success.
Can you please tell me how I can hide the mini-toc for a chapter or a topicref that has outputclass="no-minitoc"?
Another issue is with how links are published in pdf.
I have the following css definition for links:
Code: Select all
*[class ~= "topic/xref"]:before {
content: target-counters(attr(href), chapter-and-sections, ".") ". " !important;
}
*[class ~= "topic/xref"],
*[class ~= "topic/link"] {
font-family : "Amadeus Neue", Symbol, SimSun, "Malgun Gothic", "Microsoft JhengHei" !important;
text-decoration: underline;
color: #2e70ce;
font-weight: 300 !important;
font-size: 14pt;
line-height: 150%;
}
Thanks,
Elisabete
-
julien_lacour
- Posts: 818
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by julien_lacour »
You can remove the minitoc from topics with outputclass="no-minitoc" by using the following CSS rule:
Code: Select all
*[class ~= "topic/topic"][outputclass ~= "no-minitoc"] > *[class ~= "chapter/minitoc"] {
display: none;
}
- Declare a new extension in your publishing template:
Code: Select all
<xslt> <extension file="merged2html5Extension.xsl" id="com.oxygenxml.pdf.css.xsl.merged2html5"/> </xslt> - Add the following template in the merged2html5Extension.xsl stylesheet:
Code: Select all
<!-- Remove the <strong> node wrapping minitoc links --> <xsl:template match="strong[parent::*[contains(@class, 'topic/link')]]" mode="remove.br"> <xsl:apply-templates mode="#current"/> </xsl:template>
Regards,
Julien
-
elisabete reis
- Posts: 10
- Joined: Thu Mar 10, 2022 6:07 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by elisabete reis »
thanks, the mini-toc is sorted out. But not the links.
This happens everywhere in the ditamap, not only in the mini-toc. And what is bold is the line under the link, not the link itself, for instance:
Code: Select all
<li>
<p>Complete the fields as described in the relevant section:</p>
<ul>
<li><xref keyref="how-to-add-a-simple-rule-criterion-to-a-rule"/>.</li>
<li><xref keyref="how-to-add-a-multiple-rule-criterion-to-a-rule"/>.</li>
<li><xref keyref="how-to-add-a-relative-rule-criterion-to-a-rule"/>.</li>
</ul>
</li>Code: Select all
<li>
<p>Select the parameter and operator from the drop-down lists.</p>
<p>For more information, see <xref keyref="ap-pcv-parameters"/>. and <xref
keyref="ap-operators-and-wildcards"/>. </p>
</li>-
julien_lacour
- Posts: 818
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by julien_lacour »
If you increase the zoom in Acrobat, does the underlining remains thicker?
This problem seems similar to disappearing thin lines in cells.
Regards,
Julien
-
elisabete reis
- Posts: 10
- Joined: Thu Mar 10, 2022 6:07 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by elisabete reis »
With zoom the problem is the same but disabling the "Enhance thin lines" solved the problem.
Thanks a lot
Elisabete
-
elisabete reis
- Posts: 10
- Joined: Thu Mar 10, 2022 6:07 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by elisabete reis »
I found some situations where the code given to hide the mini-toc doesn't work properly, using this:
Code: Select all
*[class ~= "topic/topic"][outputclass ~= "no-minitoc"] > *[class ~= "chapter/minitoc"] {
display: none;
}this topic has a child but I don't want the minitoc to be displayed. I added the outputclass="no-minitoc" to the topic in the ditamap but the result is an empty topic with just the title:
Code for the Topic:
Code: Select all
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd"[]>
<topic id="how-to">
<title>Introduction</title>
<body>
<p>This document explains how to use the application to define rules .</p>
<p id="p-2">To ensure safe and correct operation, this manual should be read before using
the application. It should be kept in an accessible location and made available to
any personnel required to use the application.</p>
<p id="p-4">The manufacturer reserves the right to carry out modifications to this manual
without prior notice.</p>
<note id="note" type="note">The names of the users, and travelers' data presented in the
images of this manual are merely indicative.</note>
</body>
</topic>Code: Select all
<chapter keyref="introduction" outputclass="no-minitoc">
<topicref keyref="about" outputclass="page-break"/>
</chapter>Thanks,
Elisabete Reis
-
julien_lacour
- Posts: 818
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by julien_lacour »
You're right my first rule was too strict, you need to filter chapter/minitoc children:
Code: Select all
*[class ~= "topic/topic"][outputclass ~= "no-minitoc"] *[class ~= "chapter/minitoc-links"] {
display: none;
}
/* Reset topic layout */
*[class ~= "topic/topic"][outputclass ~= "no-minitoc"] *[class~="chapter/minitoc-desc"] {
display: block;
width: unset;
padding-left: 0;
border-left: none;
}
Julien
-
elisabete reis
- Posts: 10
- Joined: Thu Mar 10, 2022 6:07 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by elisabete reis »
Now I have the content in the chapter but it is formatted as it was a minitoc.
I have defined css to style the minitoc. So when I have a minitoc it looks like this:
Code: Select all
*[class ~= "topic/topic"][outputclass ~= "no-minitoc"] *[class ~= "chapter/minitoc-links"] {
display: none;
}
/* Reset topic layout */
*[class ~= "topic/topic"][outputclass ~= "no-minitoc"] *[class~="chapter/minitoc-desc"] {
display: block;
width: unset;
padding-left: 0;
border-left: none;
}
*[class ~= "topic/topic"] > *[class ~= "chapter/minitoc"]:not([outputclass ~= "no-minitoc"]) {
border-style:solid;
border-color:#DCDCDC;
border-width:1pt;
border-radius: 10px;
width: 80%;
margin-left: 30pt;
}
*[class~="chapter/minitoc-links"] *[class~="topic/desc"] {
display:none;
}
*[class~="chapter/minitoc-desc"], *[class~="chapter/minitoc-links"] {
display:block;
margin-left: 20pt;
margin-bottom: 20pt;
margin-right: 10pt;
}
*[class~="chapter/minitoc-links"] *[class~="topic/link"]{
margin-bottom: 4px;
margin-top: 4px;
}
*[class~="chapter/minitoc-links"] *[class~="topic/link"] a {
color : var(--color-dark-sky);
font-weight: normal;
font-size: var(--default-font-size);
line-height: 150%;
text-decoration: underline;
}
*[class~="chapter/minitoc-links"] *[class~="topic/link"] a::after {
content: leader('-') target-counter(attr(href), page) !important;
font-size : var(--default-font-size);
font-weight : normal ;
color : var(--color-dark-sky);
text-decoration: underline;
}
*[class~="chapter/minitoc-links"] *[class~="topic/link"] a::before {
content: target-counters(attr(href), chapter-and-sections, ".") ". " !important;
text-decoration: underline
}-
elisabete reis
- Posts: 10
- Joined: Thu Mar 10, 2022 6:07 pm
Re: Exclude mini-toc from a chapter based on output class and wrong links formating
Post by elisabete reis »
I found how to solve the issue.
Code: Select all
*[class ~= "topic/topic"]:not([outputclass ~= "no-minitoc"]) > *[class ~= "chapter/minitoc"] {
border-style:solid;
border-color:var(--default-link-color);
border-width:1pt;
border-radius: 10px;
width: 80%;
margin-left: 30pt;
}elisabete
Return to “DITA (Editing and Publishing DITA Content)”
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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