Automatic permalinks for headings

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets

Automatic permalinks for headings

Postby ruusuvuori on Tue Aug 27, 2019 8:46 am

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.
ruusuvuori
Jr. Propeller Head
 
Posts: 2
Joined: Tue Jan 30, 2018 4:48 am

Re: Automatic permalinks for headings

Postby jjw on Tue Aug 27, 2019 3:36 pm

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.
jjw
Sr. Propeller Head
 
Posts: 133
Joined: Thu May 08, 2014 4:18 pm
Location: Melbourne

Re: Automatic permalinks for headings

Postby ruusuvuori on Wed Aug 28, 2019 1:30 am

Thanks, need to play around with that :)
ruusuvuori
Jr. Propeller Head
 
Posts: 2
Joined: Tue Jan 30, 2018 4:48 am


Return to Web-based Outputs

Who is online

Users browsing this forum: No registered users and 2 guests