Synopsis 0.5 - User Manual

Options

Other options than those mentioned above for specific pages are:

verbose

Boolean flag. If set to true then extra info is printed to the console at various stages. For example, timing information will be shown for each Page, allowing you to see which Pages are taking the longest.

pages

A list of import specifications for the Pages to use. The default attribute is "htmlPageClass" and the default package is "Synopsis.Formatter.HTML.". The default value of "pages" is: [ 'ScopePages', 'ModuleListing', 'ModuleIndexer', 'FileListing', 'FileIndexer', 'FileDetails', 'InheritanceTree', 'InheritanceGraph', 'NameIndex', 'FramesIndex' ]

sorter

An import specification for a Sorter object to use for sorting declarations in many places (eg: ScopePages). The default is to use the builtin class Synopsis.Formatter.HTML.ScopeSorter, else you can write your own with the same interface.

datadir

String that sets the data directory containing Synopsis' images. This is usually set as a default option in Config.py by configure, so that a Synopsis installed in /usr will default to /usr/share/synopsis.

stylesheet

String that sets the destination filename name of the stylesheet file used in all generated pages. Synopsis output relies heavily on CSS for formatting. The default is "style.css".

stylesheet_file

String that sets the source filename of the file to copy the stylesheet from. The default is '$prefix/share/synopsis/html.css'.

comment_formatters

This option sets a list of comment formatters to use for formatting AST comments. The comments should have already been processed in the Linker stage to extract @tags and create summarys - the formatters are responsible for converting the processed info into HTML output. The formatters are applied in turn to the comment text, in the order they are listed. Available formatters are:

none

Dummy formatter, does nothing.

ssd

Dummy formatter, does nothing. The old "ssd" formatter is now replaced by the "ssd" comment processor in the Linker stage.

java

Dummy formatter, does nothing. The old "java" formatter is now replaced by the "java" comment processor in the Linker stage.

quotehtml

Quotes any HTML that may be in the comments. Use this if your comments include un-quoted characters like angle-brackets. Using this formatter will prevent you from using any HTML tags in your comments.

summary

Dummy formatter, does nothing. The old "summary" formatter is now replaced by the "summary" comment processor in the Linker stage.

javadoc

Formats any attributes that were processed in the Linker stage in a JavaDoc style. Currently recognised tags are: @return, @param, @see, and @attr.

qtdoc

Attempts to recognise QtDoc style tags (\sa, \param, \return). Currently broken.

section

Looks for any empty lines in the comments and replaces them with paragraph breaks. In effect, replaces any two consecutive newlines with a close paragraph followed by an open paragraph. The whole comment is also prefixed with an open paragraph and suffixed with a close paragraph.

The default is ['javadoc', 'section']

toc_out

Specifies a filename to write a TOC (Table Of Contents) file to. The TOC is an index listing the (relative) URL for each declaration in the AST. You can use the TOC to, for example, link usage of a library to the documentation of that library.

toc_in

List of strings, specifies a list of filenames to read TOC files from. You may optionally specify a prefix for each TOC file, by adding a '|' (pipe) character followed by the prefix to the end of the filename. For example, if you are specifying a TOC file for the "Foo" project, which has documentation available online at "http://foo.org/doc/", you can specify:

toc_in = [ 'Foo.toc|http://foo.org/doc/' ]

This will cause all URLs in the Foo.toc file to be prefixed with the given prefix.

default_toc

String which specifies the default page to generate TOC info from. The default is 'ScopePages'. The page specified by this option will be asked to generate the TOC for the whole AST. The TOC is used internally to generate the default links for all AST declarations - on source pages, scope pages, XRef pages, module and file listings, etc. You can set this to 'XRefPages' to default to showing XRef info for the declaration. No other Page can be used. See the 'toc_from' option of the FileSource Page for a similar option.

tree_formatter

Import specification which specifies the object to use for formatting trees in the ModuleListing and FileListing pages. The base package for the import is 'Synopsis.Formatter.HTML.'. The default is 'TreeFormatter.TreeFormatter'.

file_layout

Import specification which specifies the FileLayout object to use. The default is 'Synopsis.Formatter.HTML.FileLayout', but you can also specify 'Synopsis.Formatter.HTML.NestedFileLayout' to put the output in different directories depending on the Page and Namespace/Module.

output_dir

String which specifies the directory to output the HTML files into. The directory does not need to exist beforehand.

structs_as_classes

A boolean flag, which if true causes C++ structs to be listed in the same sections as the classes. Use this if your project uses structs similarly to classes and you want them to be displayed together.

page_format

An import specification which specifies the format to use for generating all output pages. The default package is 'Synopsis.Formatter.HTML.Page.'. The default is 'PageFormat', but you may also specify 'TemplatePageFormat' to use a template file for each output file.

To use the TemplatePageFormat, create a template HTML file with the formatting you require. Ensure that the string "@TITLE@" is in the <title> element, and the string "@CONTENT@" is where you want to the Synopsis output to go. Then add a TemplatePageFormat config sub-object to the HTML config and set these options:

file

Specifies the template filename to use

copy_files

Specifies a list of files that will be copied to the output directory. Use this for things like images. Each entry in the list is a 2-tuple giving the original filename and final filename.

An example taken from the C++ demo is:

    class HTML (Config.Base.HTML):
        class TemplatePageFormat:
            file = 'template-sxr.html'
            copy_files = [('gapbuffer-logo.png', 'logo.png')]
 

In addition, you may use the following command line arguments. Except for "-o", they must all be set using the "-Wf,foo" syntax.

-o filename

Specifies an output directory. You do not need to use special syntax for this option.

-v

Enables verbose operation.

-d datadir

Sets the data directory where images and stylesheets will be loaded from by default.

-s stylesheet

Sets the name of the stylesheet in the generated manual directory (not the original file!)

-S stylesheet_file

Sets the filename of the stylesheet to copy into the generated manual directory.

-n namespace

Sets the namespace ???

-c comment_formatter

Specifies an additional comment formatter to use. The given comment_formatter must be either an object name accessible from the available PYTHON_PATH, or a filename with global functions matching the requirements.

-C comment_formatter

Specifies an additional inbuilt comment formatter to use. See the CommentFormatter section above for a list of available comment formatters.

-t toc_filename

Specifies that the TOC should be written to the given filename.

-r toc_filename

Specifies that the TOC should be read from the given filename. The read TOC is merged with the current TOC.