You can set values for some commonly altered variables. Currently, the configuration file lets you set these things:
The copyright notice that appears at the bottom of the HTML pages. Unless you specify a value, no copyright will appear.
By default, HeaderDoc generates class documentation in a way that matches
Specifies the Apple TOC format. This format requires extensive JavaScript and CSS support, and thus is not very useful outside of the developer.apple.com website. It is documented only for completeness.
The name of the file containing the frameset instructions (by default, index.html).
The name of the file containing the printable HTML page (by default, CompositePage.html).
The name of the file containing the master table of contents for a series of headers (by default, masterTOC.html). (This variable is used by the gatherHeaderDoc script, and can be overridden on the command line.)
The prefix for named anchors (by default, apple_ref). In the output, HeaderDoc adds a self-describing named anchor near each API declaration—for example <a name="//apple_ref/c/func/CFArrayAppendValue">. These can be useful for index generation and other purposes. See “Symbol Markers for HTML-Based Documentation” for more information.
A list of tokens to leave out of the final output if they occur at the start of a line (before any other non-whitespace characters). While this feature still exists, it is usually better to use C preprocessor directives.
A string (generally a server-side include directive) that HeaderDoc will insert into the bottom of each right-side and composite HTML page if you specify the -H flag on the command line. For longer headers, use htmlFooterFile.
A file containing a longer HTML footer. The contents of this file will be added to the end of each content page if you specify the -H flag on the command line.
A string (generally a server-side include directive) that HeaderDoc will insert into the top of each right-side and composite HTML page if you specify the -H flag on the command line. For longer headers, use htmlHeaderFile.
A file containing a longer HTML header. The contents of this file will be added at the top of each content page if you specify the -H flag on the command line.
Setting this option to 1 tells HeaderDoc that you intend to use an external tool to create breadcrumb links in your documents. When you specify this option, it disables the insertion of the “[Top]“ link in the table of contents, since it is not necessary if you have such a tool. Because such breadcrumbs are site-specific, no such tools are provided as part of HeaderDoc.
This option causes gatherHeaderDoc to strip the trailing .h from the names of header filenames in header lists.
A string specifying the date format to be used by HeaderDoc. This date format is specified using standard time formatting flags. For examples of valid date formats, see the man page for strftime.
Specifies a list of tokens to remove from HeaderDoc markup. Generally used to remove debug macros.
These contain CSS formatting for various parts of declarations. For example:
funcNameStyle => background:#ffffff; color:#000000; |
style for characters ('a')
style for comments
style for function names
style for keywords
style for numbers
style for function parameters
style for preprocessor directives
style for strings
style for normal text if declarations (mainly parentheses, punctuation, and spaces)
style for data types
style for variable names
A file containing local headerdoc-specific CSS. The contents of the file specified will be inserted at the end of the built-in HeaderDoc styles (after any styles specified by the HeaderDoc declaration styles, such as varStyle).
A space-separated list of paths to external style sheet files on the server or destination volume. For example, if you set externalStyleSheets to /CSS/mysheet.css, HeaderDoc will insert the following:
<link rel="stylesheet" type="text/css" href="/CSS/mysheet.css"> |
These style sheets are inserted prior to any HeaderDoc-generated styles.
Like externalStyleSheets, this is a space-separated list of paths to external style sheet files on the server or destination volume. If no TOC style sheets are specified, the style sheets specified in externalStyleSheets will be used.
A string of CSS to be inserted just prior to headerdoc-generated CSS, but after any external style sheets. This was originally intended to support the @import directive to import an external style sheet, but may be used for any CSS content.
Similar to styleImports, this is a string of CSS to be inserted just prior to headerdoc-generated CSS, but after any external style sheets. This was originally intended to support the @import directive to import an external style sheet, but may be used for any CSS content.
If no TOC style imports are specified, the value of styleImports will be used for the TOC.
Specifies a TOC template file to use instead of the built-in TOC template. For more information, see “Creating a TOC Template File.”
A space-separated list of paths to external files, each of which contains a list of cross references outside the current document. When gatherHeaderDoc runs resolveLinks to link together cross-referenced content, it passes these external cross-reference files to resolveLinks so that you can look up API references (apple_ref-style markup) in other documents.
For more information, see “Symbol Markers for HTML-Based Documentation.”
A space-separated list of prefixes for API references. When gatherHeaderDoc runs resolveLinks, it passes this list of prefixes to resolveLinks. This allows you to use (multiple) API reference prefixes other than apple_ref.
For more information, see “Symbol Markers for HTML-Based Documentation.”
HeaderDoc looks in three places for values for these variables, in this order:
In the script itself (see the declaration of the %config hash near the top of headerDoc2HTML).
In the home directory of the user, in Library/Preferences/com.apple.headerDoc2HTML.config
In a file named headerDoc2HTML.config in the same folder as the script.
A variable can be assigned a value in any of these places, but only the last value read for a given variable will affect the output of a run of the script. If you are happy with the default values for these variables (as described above), you don't need to provide a configuration file. If you want to change just one or more values, provide a configuration file that declares just those values.
The format of the configuration file is this:
key1 => value1 |
key2 => value2 |
Listing 3-1 is an example of a very basic HeaderDoc configuration file. Several additional examples are included as part of the HeaderDoc distribution.
Listing 3-1 Sample HeaderDoc configuration file
copyrightOwner => My Great Software Company |
defaultFrameName => default.html |
compositePageName => PrintablePage.html |
masterTOCName => TOCCentral.html |
apiUIDPrefix => greatSoftware |
ignorePrefixes=> CF_EXTERN|CG_EXTERN |
htmlHeader=> |
dateFormat=> %m/%d/%Y |
Many of the CSS options in HeaderDoc disable the built-in styles so that it is easier to override those styles in external style sheets. The built-in styles are listed below for your convenience.
Listing 3-2 Built-in HeaderDoc CSS Styles
a:link {text-decoration: none; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: small; color: #0000ff;} |
a:visited {text-decoration: none; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: small; color: #0000ff;} |
a:visited:hover {text-decoration: underline; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: small; color: #ff6600;} |
a:active {text-decoration: none; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: small; color: #ff6600;} |
a:hover {text-decoration: underline; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: small; color: #ff6600;} |
h4 {text-decoration: none; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: tiny; font-weight: bold;} |
body {text-decoration: none; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 10pt;} |
Last updated: 2009-11-17