Exclude content not linked directly ... and Alias.xml?

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
gbusch
Propeller Head
Posts: 44
Joined: Wed Mar 26, 2014 8:52 am
Location: Germany

Exclude content not linked directly ... and Alias.xml?

Post by gbusch »

Hi forums,

I recently noticed, if you select the option "Exclude content not linked directly or indirectly from the target" in our target output, Flare excludes topics that are only linked by the alias file.

This makes the whole option pointless to me.
Am i missing something here?
Or is this a bug?

I have thousands of topics.
I cannot put them all in the toc.
And I cannot keep track of wich topic is linked by wich one and place links to all required topics by myself just to make sure that they will be included in output.
Anyway, i already did: In the alias file!
Doesn't that count to Flare?
I expect, that a link from the alias file to a topic should include that topic, since it is linked indirectly.

If i disable that option the output will be bloated as hell.
Since some topics and many images will be shared across different outputs i cannot just use conditions.
MattyQ
Sr. Propeller Head
Posts: 136
Joined: Tue Sep 30, 2014 7:10 am
Location: Roanoke, VA

Re: Exclude content not linked directly ... and Alias.xml?

Post by MattyQ »

Unfortunately, I've never seen that feature work fully as expected. It will also exclude any files you link to from your stylesheets (for example, custom icons for a note style, or fonts), even though the stylesheet is included by the target. It appears to be at best a loose definition of "indirectly linked." I imagine there are additional files it ignores/leaves behind. Because of this, I've found it's more straightforward to organize your project such that condition tags can be used sparingly on folders to an effect similar to what I'd expect that check box to have.

In the past, briefly before we decided this wasn't the way we wanted to go, we created a bunch of invisible links at the bottom of a topic (<a style="display: hidden;" href="...") that linked to the files we needed so that way they'd be included as expected. In the end, we decided this wasn't good practice and not super maintainable.
gbusch
Propeller Head
Posts: 44
Joined: Wed Mar 26, 2014 8:52 am
Location: Germany

Re: Exclude content not linked directly ... and Alias.xml?

Post by gbusch »

Thanks for your reply.

This are no good news.
Anytime i got a workaround for a problem with flare, a new one pops up wich is more difficult to solve :(
I managed to convert some projects to Flare, but sometimes i wish i could go back since the workflow with flare seems to be more awful the more i work with it. If single-sourcing with Flare means to do multiple redundant or more complex tasks just to make the single-sourcing working it is not better than having mutliple sources where i have to do the same amount of tasks.

Anyway, no reason for me to give up yet.

I had a similar idea like your invisible links.
The difference is that my links aren't invisible, but the topic ;)
This means in the toc there is one Book-Entry with no linked topic but a condition that is exluded from the output.
Under that book there is an entry with a link to that topic that holds the list of links to all used topics.
So in the CHM output you won't see that entry, but it will be included.
And this means anythin else that is required too.

Can you shed any light why this approach was not the way to go for you and how you managed to get around this using conditions?

I managed at least to apply conditions to the most of topics so that mostly only those topics will be included in the CHM file, that are required. But i wasn't able to do the same with images. So my CHM file still bloats from 1 MB up to 10 MB :(

Any chances to get an index-proxy (or something similar) working in a CHM output?
The idea is, if Flare considers a topic being linked only by a real hyperlink, all i need is one topic for each output with a list of hyperlinks to all used topics. So if any topic has at least one keyword (e.g. the topics title) it should appear in the index. And if there is a link from an "index-topic" flare should include the file, shouldn't it?

Unfortunately i can't test that idea since the index-proxy seems not to be processed on CHM output :(
Is there any way to get such a auto generated list of files on buildtime?
Last edited by gbusch on Fri Apr 15, 2016 3:10 am, edited 1 time in total.
gbusch
Propeller Head
Posts: 44
Joined: Wed Mar 26, 2014 8:52 am
Location: Germany

Re: Exclude content not linked directly ... and Alias.xml?

Post by gbusch »

You won't believe it!

The problem seems to be the order of Flares building process.
First it seems to search for all linked files inside the toc, topics, and snippets - in brief: only in "content related files"!
These linked files will be copied to the temporary folder.
And when the output is built it uses only the files in the temporary folder.
The alias file seems to be processed after the files have been copied to the temp folder.
And when the alias file is processed it actually tries to include the files of the alias file.
But since some files are linked only by the alias file and therefore were not copied to the temp folder it cannot find the linked file.
You can even see this in the logs.
It says something like "Missing topic" instead of "excluded" or anything else that would make more sense.

Solution?
Simply place an invisible link to the alias file in your CHM default topic. (or any other topic that will be always present in your output)
No joke!

If there is a link to the alias file inside a topic, flare will also parse the linked alias file for links before the alias file is processed. And therefore all required files will be copied to the temp folder before the alias file is processed.

Solved!

:mrgreen:
Post Reply