Skip to main content
April 8, 2011
Question

How to generate table of contents from headings in HTM files

  • April 8, 2011
  • 1 reply
  • 902 views

Hi -

I have created approximately 20 HTM files.  Each HTM file contains heading tags (<h1>, <h2>, ...).  We would like the "Contents" tab in the CHM file to follow the headings in the HTM file.  Here is an example.  Suppose the first HTM file contains the following

<h1>File1 Heading1</h1>

<h2>File1 Heading2</h2>

and the second HTM file contains the following

<h1>File2 Heading1</h1>

<h2>File2 Heading2</h2>

Then in the "Contents" tab of the CHM file we would like to see the following

File1 Heading1

File1 Heading2

File2 Heading1

File2 Heading2

When I edit the table of contents in RoboHelp it looks like I need to manually create the books and pages.  That is going to be quite a bit of maintenance for us.  Is there any way to automatically generate the table of contents from the headings?

Any help on this would be greatly appreciated.

Thank you -

Karen Ahmad

This topic has been closed for replies.

1 reply

Peter Grainge
Community Expert
Community Expert
April 8, 2011

I haven't seen anyone publish a way of achieving this. Auto-create is based on folders in project manager rather than headings so that will not help you.

To get headings within topics you will need to create bookmarks. That is going to be a lot of work. The norm is H1 only as otherwise you end up with a massive TOC and it becomes self defeating as a means of navigation.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
April 8, 2011

Thanks for your response.

I'm not sure if this affects your answer.  But, the indenting in my original message did not stick when I posted it.  I'll try illustrating again using bullets.

  • File1 Heading1

    • File1 Heading2

  • File2 Heading1

    • File2 Heading2

So, in the above example both of the Heading1 entries would be books and both of the Heading2 entries would be pages.

Any help on this would be greatly appreciated.

Thank you -

Karen Ahmad

Peter Grainge
Community Expert
Community Expert
April 8, 2011

The books are not based on topics or headings. Either you create them or auto create does from the folders.

The topics are based on the topic title, regardless of heading.

Have I understood?


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.