Automatic permalinks for headings

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
ruusuvuori
Jr. Propeller Head
Posts: 4
Joined: Tue Jan 30, 2018 4:48 am

Automatic permalinks for headings

Post by ruusuvuori »

Hiya,

Is there a way to get Flare to automatically include permalinks for headings in HTML5 output?

For those unsure what I mean: if you view, for example, any readme in GitHub, hovering on headings shows a small link icon next to the heading, and if you click that, browser adds the anchor of the heading to the URL (and jumps to that anchor).

Poking around target settings did not yield any results, so looks like this is not implemented out-of-the-box in Flare? I guess the stumbling block is that Flare doesn't automatically generate anchors for headings?

Any hypothetical musings (or actual solutions!) on what kind of scripting hassle would be involved in getting this? I assume first you'd need a script that adds anchor to all headings? And then you'd probably need to work some CSS magic to get a nice hover-on style for headings to show the permalink only on hover-on?

Seems like an awfully handy feature and widely impemented, so I'm bit puzzled as to why we don't seem to have this in Flare. Am I missing something?

I'm currently using Flare 2018, if that matters.
jjw
Sr. Propeller Head
Posts: 133
Joined: Thu May 08, 2014 4:18 pm
Location: Melbourne

Re: Automatic permalinks for headings

Post by jjw »

I haven't used this directly on Flare output but there's a plugin for rehype to autolink headings - this is the git repo: rehype-autolink-headings. The heading must have an id but you can create one automatically from the heading text by also running rehype-slug.
ruusuvuori
Jr. Propeller Head
Posts: 4
Joined: Tue Jan 30, 2018 4:48 am

Re: Automatic permalinks for headings

Post by ruusuvuori »

Thanks, need to play around with that :)
Post Reply