TOC based on headers within topic

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
cdiamond
Propeller Head
Posts: 15
Joined: Tue Feb 03, 2015 4:10 pm

Re: TOC based on headers within topic

Post by cdiamond »

This is great! Thanks Dave, Corinna, & Yehuda for your contributions. I only wanted to see h2-level headings, so i modified this line:
/* find all h2 and h3 on page. Only count visible headings */
$("h2:visible,h3:visible").each(function() {

to this
/* find only h2 on page. Only count visible headings */
$("h2:visible").each(function() {

I have the latest version of flare (2019r2), but the new topic menu feature in Flare, while very useful, does not let you select which headings to display; it only goes by depth. So, I could not avoid having "h1" headings appear and only display h2. This script worked better for my needs and was really easy to implement.

The only issue I have is that the TOC links do not show up in the PDF output. Any idea how to fix that?
cdiamond
Propeller Head
Posts: 15
Joined: Tue Feb 03, 2015 4:10 pm

Re: TOC based on headers within topic

Post by cdiamond »

This is great! Thanks Dave, Corinna, & Yehuda for your contributions. I only wanted to see h2-level headings, so i modified this line:
/* find all h2 and h3 on page. Only count visible headings */
$("h2:visible,h3:visible").each(function() {

to this
/* find only h2 on page. Only count visible headings */
$("h2:visible").each(function() {

I have the latest version of flare (2019r2), but the new topic menu feature in Flare, while very useful, does not let you select which headings to display; it only goes by depth. So, I could not avoid having "h1" headings appear and only display h2. This script worked better for my needs and was really easy to implement.

The only issue I have is that the TOC links do not show up in the PDF output. Any idea how to fix that?
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: TOC based on headers within topic

Post by NorthEast »

It's a script, so it only works for HTML5 (or web based) outputs in a web browser - it won't work for PDFs.
Post Reply