Page 1 of 1
Subheadings to be visible in ToC
Posted: Tue Jun 19, 2012 8:32 am
by TechWri
I'm making web helps (from old xml-files) and the page has text like this:
Heading 1
text
Heading 2
text
Heading 3
text
These should all be on the same page, so in the same dita-file. But the table of contents should look like this:
Heading 1
Heading 2
Heading 3
Is there any way of doing this without separating the subheadings to other dita-files?
Re: Subheadings to be visible in ToC
Posted: Tue Jun 19, 2012 8:35 am
by TechWri
In the ToC there should be an indent before Heading 2 and Heading 3, it didn't show in my post. It should be seen from the ToC that these are subheadings for Heading 1.
Re: Subheadings to be visible in ToC
Posted: Tue Jun 19, 2012 10:42 am
by Radu
Hi,
In a DITA topic you can add other DITA topics.
So if your DITA topic would have the content like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic1">
<title>Heading1</title>
<body>
<p>Topic paragraph</p>
</body>
<topic id="topic2">
<title>Heading2</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
<topic id="topic3">
<title>Heading3</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
</topic>
then your DITA Map could reference individual topics from it for the TOC like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "http://docs.oasis-open.org/dita/v1.1/OS/dtd/map.dtd">
<map title="Title">
<topicref href="topic.dita#topic1">
<topicref href="topic.dita#topic2"/>
<topicref href="topic.dita#topic3"/>
</topicref>
</map>
That's the only solution I can think of without splitting the headings in different topics.
Regards,
Radu
Re: Subheadings to be visible in ToC
Posted: Tue Jun 19, 2012 11:37 am
by TechWri
I'm using consepts (not my idea...) so this wouldn't work. I'll have to think about this a bit further...
TechWri
Radu wrote:Hi,
In a DITA topic you can add other DITA topics.
So if your DITA topic would have the content like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic1">
<title>Heading1</title>
<body>
<p>Topic paragraph</p>
</body>
<topic id="topic2">
<title>Heading2</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
<topic id="topic3">
<title>Heading3</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
</topic>
then your DITA Map could reference individual topics from it for the TOC like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "http://docs.oasis-open.org/dita/v1.1/OS/dtd/map.dtd">
<map title="Title">
<topicref href="topic.dita#topic1">
<topicref href="topic.dita#topic2"/>
<topicref href="topic.dita#topic3"/>
</topicref>
</map>
That's the only solution I can think of without splitting the headings in different topics.
Regards,
Radu
Re: Subheadings to be visible in ToC
Posted: Tue Jun 19, 2012 12:28 pm
by Radu
Hi,
If your composite looks like:
Code: Select all
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
<topic id="topic1">
<title>Heading1</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
<topic id="topic2">
<title>Heading2</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
<topic id="topic3">
<title>Heading3</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
</dita>
Then the same DITA Map content I mentioned in the last post should render a similar result.
Regards,
Radu
Re: Subheadings to be visible in ToC
Posted: Tue Jun 19, 2012 12:55 pm
by TechWri
Nope, I had concepts (concept id's/conbodys etc.), but I decided to replace them with the topic-structure on this document page and got the thing working. On a web page you can't see the difference between topics and concepts so this will do.
TechWri
Radu wrote:Hi,
If your composite looks like:
Code: Select all
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
<topic id="topic1">
<title>Heading1</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
<topic id="topic2">
<title>Heading2</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
<topic id="topic3">
<title>Heading3</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
</dita>
Then the same DITA Map content I mentioned in the last post should render a similar result.
Regards,
Radu