How to merge Master and Slave projects that share one TOC

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
wijnand
Propeller Head
Posts: 55
Joined: Fri Nov 03, 2006 1:22 am
Location: Netherlands
Contact:

How to merge Master and Slave projects that share one TOC

Post by wijnand »

A big problem I noticed with people who have basically HLP files is that they are accustomed to the fact that HLP files merge the TOCS and Index files. as you can guess HTMLHELP has a limitation in that since. But there is a workaround for it. I have to warn you though, it has a LOt of manual work and its something a lot of people might find a bit daunting.

What do we need?

1. Notepad
2. HTMLHELP Workshop Download from here: (http://www.microsoft.com/downloads/deta ... laylang=en)
3. Flare

First thing we need to do is open the master project:

Make the neccesary modifications you need merge the slaves etc etc and press build. Flare will build your merge project and along with it all the neccesary changes in your TOC.
Now without any modifcation your project will look like this:

Image

A few things that we need to note for now:

1. The indexes are NOt merged
2. the TOC adds an additional layer to the entire TOC (FILENAME)-> Actual TOC so you are adding a new lever of booklets, a lot of people dont want this.
3. If you open your slave you will notice something is wrong you only open your slave chm and dont see the rest, and if you merge the rest you willsee things double.

First we will "fix" the TOC so that we remove this layer of unnecesary booklets.

Go to your Flare project folder open Output->Username->Temporary->TargetName(standard Microsoft HTML HELp)->Content

You will see the following:

Image

the files we need are:

.HHK (INDEX FiLE)
.HHC (TOC FILE)

First we will open the TOC file with notepad unedited it should look like this:

Code: Select all

	<li><object type="text/sitemap">
		<param name="Name" value="Help opvragen en gebruiken">
			</object>
	<ul>
		<li><object type="text/sitemap">
			<param name="Name" value="Inleiding">
			<param name="Local" value="html/Inleiding_algemeen.htm">
					</object>
		<li><object type="text/sitemap">
			<param name="Name" value="Help gebruiken">
			<param name="Local" value="html/Help_gebruiken.htm">
					</object>
			</ul>
	<li><object type="text/sitemap">
		<param name="Name" value="Wat is nieuw vanaf deze versie">
			</object>
	<ul>
		<li><object type="text/sitemap">
			<param name="Name" value="Nieuw in Sdu Belasting Office">
			<param name="Local" value="html/Nieuw_in_SDU_Belasting_Office.htm">
					</object>
		<li><object type="text/sitemap">
			<param name="Name" value="Wijzingen en aanpassingen">
			<param name="Local" value="html/Wijzigingen_en_aanpassingen.htm">
					</object>
			</ul>
	<li><object type="text/sitemap">
		<param name="Name" value="RBSREL">
			</object>
	<object type="text/sitemap">
		<param name="Name" value="RBSREL">
		<param name="Merge" value="RBRSREL.chm::/_temp.hhc">
			</object>

Depending on how long your TOC is , it can be really big but I decided to just show a small part of the entire picture. I removed most of mien (4 pages total) and I will focus on the what you need to change. Firstly you notice that flare automatically added for you the extra booklets most importantly the following bit:

Code: Select all

[b]<li><object type="text/sitemap">
<param name="Name" value="RBSREL">
</object>[/b] 
Remove the entire bolded part so that only the following remains:

Code: Select all

	[i]<object type="text/sitemap">
		<param name="Name" value="RBSREL.chm::/_temp.hhc">
		<param name="Merge" value="RBRSREL.chm::/_temp.hhc">
	      </object>[/i]
Make all the changes, as you need. Now we need to make a copy of this entire .HHC file because everyime flare recompiles it will remove your functional .HHC file so make a copy of it!!!. With this out of the way we now have a cleaner TOC that should end up looking like a well merged TOC. So build the project with the help of HTMLHELPWorkshop open the HHP file in HTMLHElp workshop (scroll down for a picture for where to click in HTMLHELP workshop to compile it)

but now how will be have a slave TOC that also merges the rest without having things popup double? The answer is very simple, you already edited a _temp.hhc that you got from your master TOC make an additional copy of it and name it slave.hhc. now we need to make one more edit for this .HHC file if you have a TOC inside your Master that is directed to its own topic. In my example my master toc has a few topics of its own:

Code: Select all

<ul>
		<li><object type="text/sitemap">
			<param name="Name" value="Inleiding">
			<param name="Local" value="html/Inleiding_algemeen.htm">
					</object>
		<li><object type="text/sitemap">
			<param name="Name" value="Help gebruiken">
			<param name="Local" value="html/Help_gebruiken.htm">
					</object>
			</ul>
Now if I used this TOC as a TOC for a slave project i would have broken links. So we will do a Search and replace to change: html/Inleiding_algemeen.htm"> to: SBO.chm::/html/Inleiding_algemeen.htm"> so that when i click on it, it opens the maser CHM to get the correct topic name ;)

The result will look like this:

Code: Select all

<ul>
		<li><object type="text/sitemap">
			<param name="Name" value="Inleiding">
			<param name="Local" value="SBO.chm::/html/Inleiding_algemeen.htm">
					</object>
		<li><object type="text/sitemap">
			<param name="Name" value="Help gebruiken">
			<param name="Local" value="SBO.chm::/html/Help_gebruiken.htm">
					</object>
	</ul>
Now we have 2 files out of this entire project:

1. Modified _temp.hhc file with correct and cleaned up merging
2. a _temp file that we saved as slave.hhc and modified so that the slaves can access the master.chm topics.

Now how do we merge these things together?

Firstly we need to build all the slave projects in flare so that we have recent and up to date builds/ We will now navigate to the Temporary folder again for each slave project Slave1->Output->Username->Temporary->TargetName(standard Microsoft HTML HELp)->Content

Copy the slave.hhc that we modified into this content folder. And open up the HHP file with HTMLHELP WOrkshop you should see the following:

Image

Click on the blue circle that i marked on this picture (Add/Modify Windows Defintiions) In the screen click on the files tab you will see the following:

Image

Change the TOC to slave.hhc

Save the changes

You should now have 2 .HHC files in your projcect:

_Temp.hhc - the actual TOC of the slave project
_slave.hhc - the modified TOC of your master project.

Now build the CHM file IN your HTMLHELP workshop by clicking hte following:

Image


repeat all the steps listed here for all your slave projects and you should have the following result :

Image

I will explain how to make a merged idnex in a little bit, but have some work to do ;)
GregStenhouse
Sr. Propeller Head
Posts: 330
Joined: Tue May 13, 2008 3:27 pm
Location: Christchurch, New Zealand

Re: How to merge Master and Slave projects that share one TOC

Post by GregStenhouse »

wijnand wrote:2. the TOC adds an additional layer to the entire TOC (FILENAME)-> Actual TOC so you are adding a new lever of booklets, a lot of people dont want this.
How are you merging? If selecting a Flare project or an external help file for your node in the master TOC, then in Flare v4 there is a new option under (Flare TOC item) Properties>Advanced "When merging, replace node with merged TOC"

That would be easier than modifying the TOC in notepad afterwards.

Cheers
Greg
You do not have the required permissions to view the files attached to this post.
wijnand
Propeller Head
Posts: 55
Joined: Fri Nov 03, 2006 1:22 am
Location: Netherlands
Contact:

Re: How to merge Master and Slave projects that share one TOC

Post by wijnand »

I made this before Flare 4 honestly just shared this information, havent taken the time to look at the changes in Flare 4 this deeply yet but thank you :P
wijnand
Propeller Head
Posts: 55
Joined: Fri Nov 03, 2006 1:22 am
Location: Netherlands
Contact:

Re: How to merge Master and Slave projects that share one TOC

Post by wijnand »

I just tried the option you suggested but the slave retains its original TOC. So when i opened SLAVE.toc i dont see the other slaves/master CHM files. You sure this is what its supposed to do?
GregStenhouse
Sr. Propeller Head
Posts: 330
Joined: Tue May 13, 2008 3:27 pm
Location: Christchurch, New Zealand

Re: How to merge Master and Slave projects that share one TOC

Post by GregStenhouse »

I'm not too sure what you are trying to do with the slaves, I guess that option is useful mainly for the master TOC. It sounds like your process may be the best way...

Cheers
Greg
wijnand
Propeller Head
Posts: 55
Joined: Fri Nov 03, 2006 1:22 am
Location: Netherlands
Contact:

Re: How to merge Master and Slave projects that share one TOC

Post by wijnand »

the idea behind my method (guess i am not clear on what i am doing here!) is to have the Slave have a merged TOC aswell. so instead of opening Master.CHM all the time you can open slave.CHM and see the otjher CHM files aswell. A big problem however is that it will see everything double if you merge the slave and the master using the conventional method.

With this method you basically make a shadow copy of the Masters TOC and put it as a extra in your Project. Then basically you end up with 2 TOC's in your Slave projects one that is opened by the default (the master.toc) and the slave.toc gets opened by the master.toc

I hope this is clear :)
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: How to merge Master and Slave projects that share one TOC

Post by KevinDAmery »

I may be wrong, but I don't think CHM merging works that way. I think the master can see into the slave, but the slaves can't see back into the master or into other slaves.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
wijnand
Propeller Head
Posts: 55
Joined: Fri Nov 03, 2006 1:22 am
Location: Netherlands
Contact:

Re: How to merge Master and Slave projects that share one TOC

Post by wijnand »

and this guide tells you how to circumvent it ;)

Basically this is how the master works:


Slave.chm::/_temp.hhc
Slave2.chm::/_temp.hhc

So we make a copy of our master TOC thats in the output folder of flare. And call it slave and move that into the Slave.hhp project

We tell him his "default" TOC is the Slave.hhc which basically is a rough copy of the master.toc file The master toc file still references to the _temp.hhc that we left in place basically you are "fooling it" now all your projects contain the same TOC and you can open any of them without having a suddenly cut off project.
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: How to merge Master and Slave projects that share one TOC

Post by Pete Lees »

Hi, wijnand,
First we will "fix" the TOC so that we remove this layer of unnecesary booklets.
You may want to try editing the master TOC file with FAR, available from http://helpware.net/FAR/index.html. This doesn't suffer from the same bug as HTML Help Workshop, which adds the Include statements for merged .chm files at the wrong level in the TOC.
If you open your slave you will notice something is wrong you only open your slave chm and dont see the rest
I believe that an easier alternative to your procedure is simply to modify the window definition in each slave file so that it references the TOC file of the master. So, you would open the project (.hhp) file for the slave in Notepad or HTML Help Workshop and enter, for example, master.chm::/master.hhc as the required TOC file. When editing the .hhp file in Notepad, you specify the TOC file here:

[WINDOWS]
main=,"master.chm::/master.hhc","slave.hhk","DefaultTopic.htm","HomePage.htm",...

This technique is described in the section "Step 3 - Slave Windows Definitions" in this article:

http://helpware.net/htmlhelp/how_to_merge.htm

Pete
wijnand
Propeller Head
Posts: 55
Joined: Fri Nov 03, 2006 1:22 am
Location: Netherlands
Contact:

Re: How to merge Master and Slave projects that share one TOC

Post by wijnand »

didnt think of that as a solution ;) thank you Sadly the manual editing remains :( wish it could be automated :D
Rehmen
Propeller Head
Posts: 10
Joined: Fri Aug 24, 2007 2:54 am

Re: How to merge Master and Slave projects that share one TOC

Post by Rehmen »

wijnand wrote:didnt think of that as a solution ;) thank you Sadly the manual editing remains :( wish it could be automated :D
so do i :) . I contacted Flare support half year ago (v3.1) and they responsed "Hopefully this can be corrected in a future version of Flare." But i'm still waiting :D
wijnand
Propeller Head
Posts: 55
Joined: Fri Nov 03, 2006 1:22 am
Location: Netherlands
Contact:

Re: How to merge Master and Slave projects that share one TOC

Post by wijnand »

I might make a Visual Basic/C# application to solve this, its only changing one line of text isn't it?
Post Reply