Auto-remove broken links from output

This forum is for all Flare issues not related to any of the other categories.
Post Reply
dkekesi
Propeller Head
Posts: 31
Joined: Wed Jun 05, 2013 4:56 am

Auto-remove broken links from output

Post by dkekesi »

Hi All,

I have an online help that is heavily hyperlinked all over the place. Some output types, however, do not require certain topics to be included, which results in a large number of broken links. How do I define an output so that if a link is broken it will be automatically removed from the resulting document (not the text itself, but the <a href="link.htm"> tag)? I'm sure there's a feature like this, but I can't seem to find it.

Thanks for the help.
Best regards,
Dániel Kékesi
http://www.docsoft.hu
http://www.kekesi.com
RiverMonster
Sr. Propeller Head
Posts: 148
Joined: Fri May 09, 2008 8:51 am
Location: Alicante, Spain
Contact:

Re: Auto-remove broken links from output

Post by RiverMonster »

i. Apply a condition to the topics that are not in the TOC. (That is, apply the condition to the actual topic files.)
ii. Apply the same condition to your hyperlinks. In Exclude Action, choose Unbind.
iii. Set your target to exclude this condition
> When the target is built the text from the hyperlinks is retained, but not the links

Adrian
dkekesi
Propeller Head
Posts: 31
Joined: Wed Jun 05, 2013 4:56 am

Re: Auto-remove broken links from output

Post by dkekesi »

Thanks Adrian, but this will not work in my case for the same reasons as the other issue: I'd need to know in advance what the targets will have. I have about 2000 hyperlinks in the project. Adding a condition to each of them.... well, you see my point. Not to mention what if I need to create another TOC? Do I need to go all over the hyperlinks once again?
This is typically a process that could be easily automated, and would bring a huge benefit in terms of automation.
Best regards,
Dániel Kékesi
http://www.docsoft.hu
http://www.kekesi.com
RiverMonster
Sr. Propeller Head
Posts: 148
Joined: Fri May 09, 2008 8:51 am
Location: Alicante, Spain
Contact:

Re: Auto-remove broken links from output

Post by RiverMonster »

Hi Dániel,

I see what you are trying to do now. I am not aware of a way to do this in Flare, but if your output (or intermediate output) is HTML then maybe you could hunt in Google for some free utility that is usually used to check and fix broken links on website pages.

Adrian
dkekesi
Propeller Head
Posts: 31
Joined: Wed Jun 05, 2013 4:56 am

Re: Auto-remove broken links from output

Post by dkekesi »

Is there a way to use scripting in Flare to achieve this? Or is my requirement a candidate for a feature request?
Best regards,
Dániel Kékesi
http://www.docsoft.hu
http://www.kekesi.com
RiverMonster
Sr. Propeller Head
Posts: 148
Joined: Fri May 09, 2008 8:51 am
Location: Alicante, Spain
Contact:

Re: Auto-remove broken links from output

Post by RiverMonster »

There isn't any purpose-built scripting in Flare so it sounds like a good candidate for a feature request to me. Flare is centred around the concept of a (Flare) TOC and this seems like a natural extension of that idea -- you want your TOC to drive the whole build process without the need for messing about with conditions or anything else.

Depending on your target format you could also automate this yourself in your intermediate output using any number of programming languages...
i. Scan the first html topic file for links to other topic files.
ii. For each link check if the linked topic is in your TOC file. If it is then move to the next link; if not then delete the link but retain the text.
iii. Repeat for the next topic file.

Adrian
dkekesi
Propeller Head
Posts: 31
Joined: Wed Jun 05, 2013 4:56 am

Re: Auto-remove broken links from output

Post by dkekesi »

Thanks, Adrian, for the help. I'll research this idea of yours regarding intermediate files, but I'll also file a feature request.
Best regards,
Dániel Kékesi
http://www.docsoft.hu
http://www.kekesi.com
peterc59
Jr. Propeller Head
Posts: 8
Joined: Tue Jun 21, 2016 1:22 pm

Re: Auto-remove broken links from output

Post by peterc59 »

A possible solution...

This thread is several years old, but relevant to my 2016 project in Flare v11. Our situation is similar to the original post by dkekesi:
  • The project was converted from framemaker.
  • There are thousands of cross-references with conditional text and topics.
  • We build 5 targets. If a topic is conditionally excluded, we risk a broken link (when a cross-reference source does match the condition of its destination).
Our intended solution is to replace most cross references with entries in a relationship table. This way, Flare generates links for the available topics, and ignores topics that are excluded from output.

I'm curious if anyone sees flaws in our approach?
ArmandFrvr
Propeller Head
Posts: 29
Joined: Tue Jan 08, 2013 9:48 am

Re: Auto-remove broken links from output

Post by ArmandFrvr »

I haven't looked into relationship tables but may need to. Any time someone asks us to generate a new PDF document using existing content this becomes an issue. What should be a matter of a few minutes making a new TOC becomes a huge headache of going through and seeing what links need to be removed, and hopefully without affecting other PDF documents that do include the link targets. It would be great to have the option to automatically unbind broken links in the output.
Post Reply