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?
TOC based on headers within topic
Re: TOC based on headers within topic
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?
/* 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?
Re: TOC based on headers within topic
It's a script, so it only works for HTML5 (or web based) outputs in a web browser - it won't work for PDFs.