Skip to main content
Participating Frequently
December 17, 2024
Question

Generate PDF table of contents from expanders

  • December 17, 2024
  • 2 replies
  • 607 views

Hey, maybe someone can help me here. 🙂

We have a frameless and a PDF output.

In the frameless output we have for example a topic in which we have several expanders.
Now we would like to use these expanders automatically as sub-headings in the table of contents of the PDF output.

As far as I know, RoboHelp can only generate table of contents from headings and not from expanders.

Is there a way to generate the PDF table of contents from expanders?

Thanks in advance!

This topic has been closed for replies.

2 replies

Peter Grainge
Community Expert
Community Expert
December 17, 2024

Please use the photo icon to insert images within the post. Seeing an image inline with the text makes it easier for anyone answering or viewing the post.

 

Only headings will appear so yes you will have to apply a heading style. 

________________________________________________________

My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

 

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Marvin B.Author
Participating Frequently
December 18, 2024

Alright, thank you!

Peter Grainge
Community Expert
Community Expert
December 17, 2024

What do you mean by "expander"? Do you mean expanding text or a dropdown or something else?

 

You can apply a heading style to expanding text and dropdown hotspots. 

________________________________________________________

My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

 

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Marvin B.Author
Participating Frequently
December 17, 2024

I mean dropdowns. I also attatched an example screenshot.

So I would have to apply the heading style to all dropdowns manually.
Or is it possible to automatically add the dropdowns to the table of contents of a PDF output?

Peter Grainge
Community Expert
Community Expert
December 18, 2024

That might work, but we have a lot of dropdowns and never applied a heading style.
It would take a while to do it manually, so I thought it could be done automatically.


It is obviously something that will work with your structure but it's the first time in 20+ years I have seen anyone request this. Typically dropdowns are within a section in the TOC to give additional information to some users or to hide useful but less important information. The section heading would be what is wanted in the TOC. Please don't think I am suggesting what you are doing is wrong, it's just not common and probably why there is no automated way of including dropdowns in the TOC.

 

This is the code for a dropdown.

<p><a class="dropspot" data-rhwidget="DropSpot" data-target="drop-down" href="#">Drop-down Title</a></p>

 

This is the code with a heading style applied.

<h3><a class="dropspot" data-rhwidget="DropSpot" data-target="drop-down" href="#">Drop-down Title</a></h3>

 

As you can see, the only difference is at the beginning and the end. The problem is it is difficult to change just those tags when the content in between will be different and you won't want to change all instances of the tag as that would work on other content. A regular expression is what you need and your developers may be able to help with that. AI such as ChatGPT may also help. RoboHelp's Find and Replace allows regular expressions.

 

In answer to my question ChatGPT gave this as the find

<p>(<a class="dropspot".*?</a>)</p>

and this as the replace

<h3>\1</h3>

I have not tested that.

 

You have a further issue which I don't think you have considered yet. If you use a TOC with indents, each heading will have a different indent. If a dropdown is within a H2 section, you will want H3 to indent the dropdown. However, the dropdown might be within an H3 section so you would want H4 for that.

 

While you work out how to resolve all this, please do so in a copy of the project. Otherwise there will be tears!

________________________________________________________

My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

 

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