I'm attempting to link headings within a HTML document to the TOC (Table of Contents) within the HTML Help Workshop.
For example I have a main heading <h1>Settings</h1>
that I want to appear as a folder within the TOC. I also have sub topics such as <h2>Settings Icon & Page</h2>
that I want to appear beneath the main topic for that section.
I also want to find a way that once a user clicks on this topic within the compiled help file that the page will jump to that topic.
Can someone please advise me if this is possible and how to tackle this problem?
This gives an example of what I'm trying to achieve.
Creating TOC from headings is not recommended - use single HTML files for each topic. If you want really use "Automatically create contents file" see information below.
Please note, HTML Help Workshop is free and a good learning tool but a bit dated - twenty years old. I'd recommend using a (low priced) tool like FAR HTML for creating CHM help files. Please have a look at Successor of / Alternative to HTML Help Workshop.
Building a Table of Content (TOC) by HTML Help Workshop is time consuming.
If you want to learn how to create a topic file, index file and content file, then read the documentation. For example, here's a subtopic on MSDN that describes how to create a TOC file in the HTML Help Workshop:
Create a Table of Contents File
Let's see if I can make this clearer and recommend some steps:
You know - creating help files (CHM) has a learn curve. And most work is good content from the users view.
What I'd really recommend to save some time is Rob Chandler's shareware tool FAR HTML. You can do anything with your prefered HTML-Editor outside and put FAR HTML into your workflow and the wizards are great.
One tip - don't look at all the options of FAR when starting.
Put your HTML files to structured subfolders of your project folder e.g.
welcome.htm
design.css
First_Steps\download.htm
First_Steps\starting_program.htm
How_to_extend\extend_menu.htm
How_to_extend\power_function.htm
images\gui_screenshot.jpg
Drag and drop these files to FAR
Creating TOC from headings (not recommended)
For example, if one topic file contains the following:
<html>
<body>
<h1>Main Heading<h1>
...
<h2>Second-Level Heading</h2>
...
<h3>Third-Level Heading</h3>
...
</body>
</html>
Then, when you compile using by HTML Help Workshop with "Automatically create contents file" selected, you should build a contents file in which "Second-Level Heading" is a sub-heading of "Main Heading" and "Third-Level Heading" is a sub-heading of "Second-Level Heading".
If the main heading in another topic is tagged as rather than , however, then this will occupy the same position in the TOC hierarchy as the heading shown in the example above. So, the factor that determines where a heading appears in the TOC is not whether it is tagged as an element, element, or whatever; instead, it's the heading level relative to other headings in the same topic file.
You'll need an anchor tag for jumping from TOC to a special subtopic in a single HTML file. The TOC (sitemap) file e.g. foobar.hhc Needs a section like:
<LI><OBJECT type="text/sitemap">
<param name="Name" value="How to jump to a second anchor">
<param name="Local" value="HTMLHelp_Examples/Jump_to_anchor.htm#SecondAnchor">
</OBJECT>
Some screenshots of HTML Help Workshop with options you may want use: