Generating a list of headings in a single topic

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

Generating a list of headings in a single topic

Post by rjplano »

I have a large project with many long topics. These long topics each contain up to a dozen or more h3 headings. I would like a list of links (cross references) to the h3 headings within a single topic at the top of the topic that contains those headings. Is there a way to do that automatically?

Mini-TOC doesn't work because that looks at the actual TOC, List-of Proxy would find all the h3's in the entire output, after that I'm out of ideas other than manual entry.

Thanks.
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

Re: Generating a list of headings in a single topic

Post by rjplano »

OP here.

I see now this question was asked ten years ago and a javascript answer was provided by a forum member. viewtopic.php?t=11199&p=63842. Our friend Nita suggested at the time to submit a feature request as many people are looking for that capability. I guess MadCap determined this request was not worth addressing. :( Either that or they've hidden the solution quite well.
Nita Beck
Senior Propellus Maximus
Posts: 3666
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Generating a list of headings in a single topic

Post by Nita Beck »

The forum post you linked to is 10 years old, and MadCap has since added the functionality you seek to Flare.

Use a menu proxy and associate the proxy with "Headings" rather than a TOC file.

For more info, https://help.madcapsoftware.com/flare20 ... c-Menu.htm.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

Re: Generating a list of headings in a single topic

Post by rjplano »

Thanks, Nita! I was not familiar with the Menu Proxy before you pointed it out.

I did note in my follow-up post that the post I saw was ten years old. After more searching I didn't find a solution other than the javascript implementation provided by a user, so I assumed it had it not been addressed by MadCap. I'm certainly glad to see that it has been.
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

Re: Generating a list of headings in a single topic

Post by rjplano »

The menu proxy is only listing the h1 and h2 headings, even though the Levels to Show is set to (all). I need the h3 headings to be listed. Any hints? Is there a way to show only the h3 heading text?

Thanks again.
Psider
Propellus Maximus
Posts: 810
Joined: Wed Jul 06, 2011 1:32 am

Re: Generating a list of headings in a single topic

Post by Psider »

Maybe check that the H3 doesn't have mc-heading-level set to 0 (zero) in your stylesheet?
rjplano
Propeller Head
Posts: 51
Joined: Tue May 05, 2020 10:08 am

Re: Generating a list of headings in a single topic

Post by rjplano »

Psider wrote:Maybe check that the H3 doesn't have mc-heading-level set to 0 (zero) in your stylesheet?
That was it! Nice catch Psider.

Thanks.
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Generating a list of headings in a single topic

Post by Rona Kwestel »

Call me crazy, but when I use the menu proxy with the Headings option, I want the list to start at the h2 level. I certainly don't need a clickable link to the h1 heading that functions as the title of the page. This feature is so easy to use in Confluence and works just as you would expect; why can't we have it the same way in Flare? And yes, I'm going to submit a feature improvement request.
Psider
Propellus Maximus
Posts: 810
Joined: Wed Jul 06, 2011 1:32 am

Re: Generating a list of headings in a single topic

Post by Psider »

I think I figured out how to do that. I think I set the H1 to mc-heading-level: 0 in my stylesheet. This may cause problems if you need print output though; it's not something I've tested thoroughly.
robdocsmith
Sr. Propeller Head
Posts: 246
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Generating a list of headings in a single topic

Post by robdocsmith »

I wonder if like other Proxies there are associated styles like p.MenuProxy1 thru 6? If so you could set p.MenuProxy1 to display:none;
Just a thought and I've not tested it, then it wouldn't affect the other TOCs in your project. But that would also assume that your menu proxy was always at the same level, just under a H1...

Rob
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Generating a list of headings in a single topic

Post by Rona Kwestel »

Thanks, psider. I just tried it, but then you need to set another style to turn off the bolding of the "selected" class assigned to the first entry in the list.

Code: Select all

h1 {
    mc-heading-level: 0;
}

ul.menu._Skins_Menu.mc-component li > a.selected,
ul.menu._Skins_Menu.mc-component li > a.selected:hover {
    font-weight: inherit;
}
And this would impact print settings, though I imagine you can fix it by setting this in the @media print section:

Code: Select all

@media print {
    h1 {
        mc-heading-level: 1;
    }
}
Rob, I had tried playing with the display property for the same selector as the unbolded one above and that did work:

Code: Select all

ul.menu._Skins_Menu.mc-component li > a.selected {
    display: none;
}
But then you end up with weird list spacing/indentation because the remaining list is still "nested", and heaven help you if you want to add any bullets to the list - it was a bit of a mess.

Bottom line, this should be an easy feature to use without having to jump through arcane hoops to force it to do what it should do in the first place.
Post Reply