How to merge

  
of multiple HTML help files; have you ever thought about if you have released several small games separately and wrote HTML help for these small games. Suddenly one day, you plan to put these small games together into a "game paradise". Do you want to compile their help document source files (.htm) again? Adding an HTML track is very convenient, but is that a bunch of directories and indexes that need to be rewritten? - God, the most painful thing in life is this.

It doesn't matter, although sometimes Microsoft's stuff is really bad, but this time, it comes to mind - it provides a very convenient Merge function that combines directories, indexes, and even full-text search dictionaries. .

How do you start? Remember the last thing in the "Setting Project Options" section? That's right, it's from here: the Merge Files property page of the Project Options dialog. But before we need to create a new HTML help project, all production will be done in this project.

The Merge Files property page has only two buttons, Add() and Remove(Remove). I don't think they need to be introduced. Just add the files you want to merge here, and the first step is simple. Keep in mind, however, that this merge is not a true merge - the size of the generated HTML help file is almost as large as it was before the merge. Therefore, when publishing the help documentation, you need to publish the merged HTML help together.

There is still a problem. I have searched all the links after compiling, and I can't open the merged help files. What is wrong? Don't worry, we just finished the first step, but after doing this, the index of the merged HTML help file and the full-text search dictionary have been merged. Have you not found it? That is why you are not careful.

The next step we have to do is to merge the directories.

Add a directory file to the newly created project, of course, it is new. Then right click on the blank popup menu. The first two items of the menu have been introduced in the section "Adding Contents and Indexes to Help Files". The third "Insert File..." is the highlight of this section.

Click on the "Insert File..." menu item, a dialog called "Include File" will pop up, select the HTML help file (.chm) you want to merge, and then...not finished yet, you still Need to add the following text

.....chm::contents.hhc

The front .....chm is the file of your choice, the following ::contents.hhc is I want you to enter it. Where contents.hhc should be filled in according to the actual directory file name you are using, and this directory file is .....chm, not the current project. If you still don't understand, take a look at the example below.

Compile and run, everything works, the merges are merged, and the contents of the merged help file can be found from the directory. However, this seems to be a bit wrong - I will say something that needs attention.

First, we didn't add a theme file to this new project. What are the consequences? Think about what happens when you use IE to browse a page that doesn't exist. Any HTML help has a default page. We are no exception to create this new project. Although it incorporates other HTML help, it still doesn't have its own default page. Conclusion: Add a theme file to it anyway, even if the cover is good.

Second, HTML Help Workshop There is a bug here, for free BUG, ​​the second point you need to pay attention to is: want to merge the file node in the directory is the byte point of a child node, It should be made to be in the same level as this node when editing. Sometimes we will see an example of linking from one help page to another, such as MSDN, which is how it is implemented. In fact, this is not the job of the HTML Help Workshop, but the work of the theme file (.htm). You need to insert an ActiveX control with HTML help in the HTML file, which is not detailed here.

Copyright © Windows knowledge All Rights Reserved