back to DeepTOC page


DeepTOC - v.1.00 - 21 June 2005
-------------------------------------------------------------------------------

By default, WebWorks 2003 only lets you generate a TOC of up to 5 levels.
Although this may be good enough for most projects, there are reasons that
people may want more levels.

The following instructions should allow you to build an HTML Help TOC with up
to 9 levels (and more with a little work). This is achieved by using the
generated FrameMaker TOC to build the HHC file rather than using the built-in
HHC-builder in WebWorks 2003. The files and macros used for this example were
taken from WWP 6 and retrofitted to work in WWP 2003.

This example is provided as a proof of concept and not really intended to be a
complete solution. Although, you should be able to take pieces from this and
fold it in to your template since it does appear to do what's needed.

This example is provided on an "as-is" basis with no warranty of any kind
implied or given. Please make backups before modifying your files.

If you find any errors or inaccuracies in the sample files or instructions,
please let me know.

Enjoy!

Scott Prentice
Leximation, Inc.
www.leximation.com



To Implement the "Old-Style" TOC Handling in WWP 2003
-----------------------------------------------------

Note that these instructions assume that your current template is based on
the Microsoft HTML Help 1.x template.

0. IMPORTANT! Make a backup of your project! Do not make these modifications
   unless you have a complete backup of your existing project.


1. Copy the DEEPTOC.HHC file to your SUPPORT folder.

2. Make the following changes to Project Options:

   Project Options > General:
	- Select "Use pre-2003 file naming conventions"
   Project Options > FrameMaker:
	- De-select "Automatically remove TOC and IX when adding books"

3. Make the following changes in the Style Designer:

   Building Blocks: BP80PageASP_SetPrevNext:
	- To prevent the "Prev" navigation link from accessing the generated
	  TOC page, change this ..
...
$COMMENT(
  Previous
);\
@SET_PROP(var_PageLinks, Previous,
  $IF_EXISTS($PAGEPREV(html, name, $CHARSET;);,
    $PAGEPREV(html, name, $CHARSET;);\
);\
);\
...

	- To this ..
...
$COMMENT(
  Previous
);\
@SET_PROP(var_PageLinks, Previous,
  $IF_EXISTS($PAGEPREV(html, name, $CHARSET;);,
    $IF_NOTEQUAL($PAGEPREV(html, name, $CHARSET;);,
      $PAGEFIRST(html, name, $CHARSET;);,
    $PAGEPREV(html, name, $CHARSET;);\
);\
);\
);\
...

   Building Blocks: BP80BZOnConvertAllEnd:
	- To replace the default HHC with the FM-based HHC, add two new
	  "@COPY" lines to this macro. In the default template they go as
	  shown below ..

...
$BP80TOC_Write;
$BP80Index_Write;
$BP80Popups_Write;
$BP80Search_Write;

@COPY(overwrite, host, $OUTPUTDIR;$SEP;toc.hhc, $OUTPUTDIR;$SEP;toc-old.hhc);
@COPY(overwrite, host, $OUTPUTDIR;$SEP;toc-new.hhc, $OUTPUTDIR;$SEP;toc.hhc);
...

4. Import the Styles (Paragraphs, Pages, Building Blocks, and User Macros) from
   the example "testtoc-macros" template. This template has been stripped down
   so it only contains the macros listed below so you can safely import it into
   your template without messing with other macros.
	- Paragraphs: hhTOC1 through hhTOC9
	- Pages: TOC
	- Building Blocks: BBIterTOCItem
	- Building Blocks: BBTOCTitle
	- User Macros: UMTOCFilter

5. Add the FrameMaker TOC to your project. Make sure that the Frame TOC is
   first in the list.

6. Make the following changes in Project Mappings:
	Mappings tab - Map the "TOC" source styles to the "hhTOCn" WebWorks
	    styles as appropriate. (Don't worry about setting the "In TOC"
	    values, since the HHC built based on those settings will be
	    overwritten.)
	Output tab - Set the name of the FM TOC to "toc-new.hhc", and make
	    sure that the Current Mapping is set to "TOC".

That should do it!

Cheers!

...scott