Click here to Skip to main content
15,881,709 members
Articles / Operating Systems / Windows

Sandcastle Help File Builder

Rate me:
Please Sign up or sign in to vote.
4.93/5 (131 votes)
17 May 2007Ms-PL45 min read 997.8K   5.3K   291  
A GUI for creating projects to build help files with Sandcastle and a console mode tool to build them as well.
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../styles/Styles.css">
<title>Defining the Table of Content Layout</title>
</head>

<body>

<h2>Defining the Table of Content Layout</h2>
All HTML files copied as additional content will automatically be added
to the help file's table of content.  When the sub-folders of "*.*"
wildcard entries are copied that contain HTML files, the sub-folders will
also create folder entries within the table of content and the HTML files
within them become children of the folder entry in the table of content.
This makes it fairly simple to create hierarchical content with matching
table of content entries.  The table of content will mimic the folder
structure on disk.

<p/>The help file builder scans each HTML file for the following tags and
specially formatted comments that allow you to define the related properties
of the table of content entries.  They can appear anywhere in the file.

<ul>
    <li><code>&lt;title&gt;Page Title&lt;/title&gt;</code> -  The value
from the title tag in the HTML file is used as the title in the table of
content.  If no title tag is found, the filename without the path and extension
is used as the title.</li>
    <li><code>&lt;!-- @TOCExclude --&gt;</code> - This special comment can
be used to exclude the page from the table of content.  The file will still
be copied to the output folder but will not appear in the table of content.
Instead, a link to it must exist from another help page.  This is also
useful for setting the title and sort order on folder entries without
associating a page with the folder entry in the table of content.  See
below for more information.</li>
    <li><code>&lt;!-- @DefaultTopic --&gt;</code> - This special comment is
used to indicate that the page should be selected as the default topic for
the help file.  If multiple pages contain this comment, the last one seen
will be used as the default topic.  If no additional content items are defined
or none are marked as the default topic, the root namespaces page is selected
as the default topic.</li>
    <li><code>&lt;!-- @SortOrder nnn --&gt;</code> - This special comment
is used to set the sort order of the item within the group where "nnn"
represents an integer value.  The "group" is all other additional content
table of content entries at the same level as the current item.  In the
absence of a sort order indicator, table of content entries are sorted
alphabetically.  By specifying a sort order, you can rearrange the entries
in a different order.  Items within a group that have the same sort order
value will also sort alphabetically.  Items without a sort order indicator
are placed below those with a sort order indicator and are sorted
alphabetically.</li>
</ul>

<p/>By default, folder entries in the table of content will not have any
HTML page associated with them and will not show a specific page in the
help file when selected.  The title will be the folder name and they will
be sorted alphabetically within the same group of items below any items
that have a sort order indicator.  You can control these properties for
folder entries by placing an HTML file in the folder that has the same name
as the folder (i.e. place a file called <b>OtherContent.html</b> in the
<b>OtherContent</b> folder to set its properties).  If the
<code>@TOCExclude</code> comment does not appear in the file, the
associated page will be displayed when the folder is selected in the table
of content.  Below are a couple of examples:

<pre lang="xml" title="OtherContent\OtherContent.html">
&lt;!-- @TOCExclude --&gt;
&lt;!-- @SortOrder 3 --&gt;
&lt;title&gt;Other Content&lt;/title&gt;
</pre>

<p/>This example sets the sort order and title of the folder entry but does
not display anything when the folder is selected as it contains the
<code>@TOCExclude</code> comment.

<pre lang="xml" title="FolderWithPage\FolderWithPage.html">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Folder Entry with a Content Page&lt;/title&gt;
&lt;/head&gt;

&lt;!-- @SortOrder 2 --&gt;

&lt;body&gt;
This is a content page for a folder entry in the
table of content.
&lt;/body&gt;
&lt;/html&gt;
</pre>

<p/>This example sets the sort order and title of the folder entry and
specifies content that will be displayed when the folder is selected as the
<code>@TOCExclude</code> comment is omitted.  It could also be made the
default topic by adding the <code>@DefaultTopic</code> comment.

<br/><br/>
<include item="footer"/>

</body>
</html>
<!-- @SortOrder 2 -->

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Software Developer (Senior)
United States United States
Eric Woodruff is an Analyst/Programmer for Spokane County, Washington where he helps develop and support various applications, mainly criminal justice systems, using Windows Forms (C#) and SQL Server as well as some ASP.NET applications.

He is also the author of various open source projects for .NET including:

The Sandcastle Help File Builder - A front end and project management system that lets you build help file projects using Microsoft's Sandcastle documentation tools. It includes a standalone GUI and a package for Visual Studio integration.

Visual Studio Spell Checker - A Visual Studio editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. This can be installed via the Visual Studio Gallery.

Image Map Controls - Windows Forms and web server controls that implement image maps.

PDI Library - A complete set of classes that let you have access to all objects, properties, parameter types, and data types as defined by the vCard (RFC 2426), vCalendar, and iCalendar (RFC 2445) specifications. A recurrence engine is also provided that allows you to easily and reliably calculate occurrence dates and times for even the most complex recurrence patterns.

Windows Forms List Controls - A set of extended .NET Windows Forms list controls. The controls include an auto-complete combo box, a multi-column combo box, a user control dropdown combo box, a radio button list, a check box list, a data navigator control, and a data list control (similar in nature to a continuous details section in Microsoft Access or the DataRepeater from VB6).

For more information see http://www.EWoodruff.us

Comments and Discussions