The output modules you can choose from are detailed below. Some generate multiple HTML files and others just one. Some use enough options that they have their own configuration sub-object, whereas others just use options in the main config object. Remember you can include or exclude any of these pages by setting the "pages" config option to a list of their names.
Each page module extends from the Page base class, which provides both an interface to use and some default functionality (opening closing files, setting filenames and titles, etc). You can write your own Page class if one of the provided ones doesn't suit you, or extend from an existing one.
This page should always go first if you want frames, else it should not be included at all. There are no options to set.
This is the most complex output Page, creating the pages for each class and namespace/module/package. It walks the whole AST creating pages as it goes using flexible "Parts" and "FormatStrategies".
For each Scope in the AST, the output page has a number of Parts. You can write your own Parts, or change the order, but the usual four are 'Heading', 'Summary', 'Inheritance' and 'Detail'. A Part is responsible for visiting all the nodes in the Scope and formatting the sections for each type of declaration. It also provides methods for referencing other declarations with correct URLs, and things like formatting Types for display (with URLs for any names in the type). Each part has a list of FormatStrategies which it calls in turn for each declaration it processes, to generate the output HTML for that declaration.
The difference between the four Parts is what declarations they process (pass to the formatters) on each page:
The Heading part only processes the scope itself, and provides things like a page title, inheritance graph, and comments for the class or module.
The Summary part processes all the children of the scope, using a set of FormatStrategies to put them in a table with summary comments. Section headings are displayed for each type of declaration (methods, variables, etc).
The Inheritance part displays the methods inherited from base classes, taking care to hide overridden methods.
The Detail part processes all the children which have detailed information, using a set of FormatStrategies to list them sequentially with full comments and more detailed info (e.g.: for enums and long typedefs, exception specifications, etc).
You can control the output by changing the FormatStrategies used by each part, writing your own FormatStrategies, or even your own Parts!
The FormatStrategies included with Synopsis are:
Formats the heading of the page for the given declaration. For classes, it shows the class name, any template parameters, a link to the file the class was in, and the module/namespace name. The module/namespace name is placed in a DIV element with class "class-namespace" that by default is floated in the top-right corner of the page.
Displays the class hierarchy around this class in a textual manner. Mainly for use if you don't have/want graphviz (dot).
Displays the class hierarchy around this class, including all parents, using the Dot formatter to create an embedded PNG image.
Formats the elements of the AST in a Summary manner. That is, two columns, with the left column for the type and the right column for the name and other details. SummaryAST actually prints the column divider (a TD element). Declarations which will appear in the Detail section are linked to automatically where the name of the declaration is (so you click on the name and it takes you to the detail). For declarations with no detailed info, the name is not hyperlinked and the #name link will be to the summary.
Formats the elements of the AST in a Detailed manner. The declaration is printed out similar to how it would in code, and the comments and other details (e.g.: values for an enum) are shown expanded.
Formats the comments of the declaration using a CommentFormatter instance, and puts them in a SPAN element of class 'summary', which in the default Synopsis CSS is italic.
Formats the comments of the declaration using a CommentFormatter instance, and puts them in a DIV element of class 'desc'.
A simple formatter that just prints the name of the declaration with a link to its documentation, intended for use in the Inheritance Part.
Formats a link to the source code for this declaration as "[Source]". The source code is actually generated by the FileSource Page, so make sure you include that if you want to use this FormatStrategy, and vice versa.
Formats a link to the cross-reference information for this declaration as "[XRef]". The xref info is actually generated by the XRefPages Page, so make sure you include that if you want to use this FormatStrategy, and vice versa.
The default lists of strategies for each "Part" are:
Heading, ClassHierarchyGraph, DetailCommenter
SummaryAST, SummaryCommenter
Inheritance
DetailAST, DetailCommenter
The ScopePages Page is the most complex to configure, since its layout is so flexible. Options are set in the sub-object "ScopePages" inside the HTML config object:
# Normal HTML config class HTML (Base.Formatter.HTML): # A sub object for ScopePages config class ScopePages: # Following options go here...
The following options are available:
A list of Part objects to use on each page. Each list item is an import specification with the base package "Synopsis.Formatter.HTML.ASTFormatter.", giving the following default parts:
parts = ['Heading', 'Summary', 'Inheritance', 'Detail']
A list of formatters to use in the Heading Part. Each list item is an import specification with the base package 'Synopsis.Formatter.HTML.FormatStrategy.', allowing you to specify any of the FormatStrategies listed earlier.
The default is:
heading_formatters = ['Heading', 'ClassHierarchyGraph', 'DetailCommenter']
A list of formatters to use in the Summary Part. Each list item is an import specification with the base package 'Synopsis.Formatter.HTML.FormatStrategy.', allowing you to specify any of the FormatStrategies listed earlier.
The default is:
summary_formatters = ['SummaryAST', 'SummaryCommenter']
A list of formatters to use in the Inheritance Part. Each list item is an import specification with the base package 'Synopsis.Formatter.HTML.FormatStrategy.', allowing you to specify any of the FormatStrategies listed earlier.
The default is:
inheritance_formatters = ['Inheritance']
A list of formatters to use in the Detail Part. Each list item is an import specification with the base package 'Synopsis.Formatter.HTML.FormatStrategy.', allowing you to specify any of the FormatStrategies listed earlier.
The default is:
detail_formatters = ['DetailAST', 'DetailCommenter']
This page creates a single output file with a tree of all packages/modules/namespaces in the AST. Each package/module/namespace is a link to an index file of that package, module or namespace.
See the tree_formatter option for how to control the formatting of the tree.
You can change the types of AST Module node which are included in this tree by creating a "ModuleListing" subobject and setting the option "child_types". For example, the Python parser creates "package" and "module" types, IDL creates "module" types, and C++ creates "namespaces".
The ModuleListing Page creates a link at the top of all pages called "Modules" that is also shown in the top-left frame. You can change this text using the "short_title" option of the ModuleListing subobject.
The following options can be set for ModuleListing:
A list of module types to show in the listing. Each type should be the string from the 'type()' method of the Module objects. Examples are 'module', 'namespace', and 'package'. By setting this you can restrict what modules are shown, such as only showing Packages in Python. The default is to print all Module nodes in the AST.
String that sets the short title of the Page that is displayed in all other Pages as a link to the ModuleListing. The default is 'Modules'.
E.g.: To only show packages and change the title:
# Normal HTML config class HTML (Base.Formatter.HTML): # A sub object for ModuleListing config class ModuleListing: child_types = ['package'] # only show packages short_title = 'Packages' # set the title to match
This page goes hand in hand with ModuleListing, creating a concise listing of the declarations in each package/module/namespace. Each declaration is linked to its documentation, but clicking on another package/module/namespace will also load its index page in this frame if the user has javascript enabled. The declarations are sorted into types and displayed in their sections, just like in ScopePages.
This page creates a single output file with a tree of all source files used to create the AST. Each file links to an index page of declarations in that file.
See the tree_formatter option for how to control the formatting of the tree.
Goes hand in hand with FileListing, creating the concise pages for each file.
If you are using the FileSource Page, a [File Source] link will automatically be included at the top of the page.
If you are using the FileDetails Page, a [File Details] link will automatically be included at the top of the page.
Unlike ModuleIndexer, the declarations are displayed in the order they were in the file, with appropriate indenting for non-global declarations.
Shows details about each file, such as what files it included and a quick list of all the declarations declared in it.
Shows source code for each file that the C++ parser created SXR info for. The actual markup of the source code is done by a C++ module for speed. The stored SXR info is used to hyperlink each identifier in the source code with a link to the documentation for that variable, class, etc, and also provide a hover text of what the identifier is, e.g: "member variable LinkStore::private::buffer_start" or "local variable main". The ability to correctly identify the identifiers is dependent on the C++ parser, which is currently pretty good except for sometimes getting overloaded functions wrong, and not understanding template instantiations too well just yet.
If the FileSource page is used should be included in the list before RawFilePages, since both compete to provide the source code for each file - and you generally want the syntax highlighted version!
The options for FileSource are set in the FileSource config sub-object:
A string containing a single "%s". When the "%s" is replaced by the filename it should give the filename of the "links" file generated by the C++ parser for that input file. The default is "./%s" but you could also use "syn/%s" or "syn/%s.syn" to give two examples.
A list of strings, each being a .TOC file to use for linking source code to declarations. The current AST is automatically linked (see toc_from below).
A string which is prepended to all names before being looked up in the (combined) TOC. For example, the Synopsis RefManual uses "Synopsis::Parser::C++::" since all the C++ types reside in that part of the AST. This is needed since the names used for lookup are generated by the C++ parser, but the types in the TOC (including the current AST) may have been changed by the Linker.
A string which names the Page to get TOC information from. The default is to use the HTML formatter option 'default_toc'. By setting this to 'ScopePages' or 'XRefPages' you can force AST declarations in the source file pages to link to either the ScopePage for that declaration or the XRef page for that declaration.
Note that in previous versions there was also a file_path option, but since version 0.5 it has been superseded by storing the original filenames in the AST along with the "base"-relative filenames.
Shows source code for each file in the project as unformatted text. See DirBrowse for info on how "files in the project" are found.
Shows directories in the project, where each file links to the source code from FileSource if available, the formatted page from RawFilePages if available, or is not a link if neither is available.
For both DirBrowse and RawFilePages the following options can be used at the HTML configuration level (i.e.: there is no sub-object, since they are used by more than one Page).
String that names the directory which is the "base" of the project, i.e., the one which all project files are named from. If you want to include the name of your project in the directory names, set base_dir to the directory containing your project directory. Relative paths can be used - they must be relative from the current directory when Synopsis is run.
String that names the directory which will be the start of the recursive directory searching. This should be below the base_dir.
List of strings. Each string is a "glob" expression (* for wildcard, ? for single-character wildcard). Any file or directory matching the glob expression will not be listed by DirBrowse.
Creates pages with cross-reference information for each declaration. Each declaration will show its parent scope, child declarations (if it's a class or module), references and places it was called from. You can navigate around the XRef documentation, but there are no comments shown so it is more useful as a navigation aide for either the source code or regular ScopePages documentation.
The XRefPages module loads compiled XRef information from a single file given in the xref_file option. The XRef information is originally generated in raw (text) format by the C++ parser. You should use the XRefCompiler Linker operation to compile the xref info.
The following options are available. They must be set in the XRefPages sub-object:
The filename of the compiled xref info. This option should be the same as the xref_file option of the XRefCompiler, unless you are running Synopsis from different directories. Synopsis cannot load the text based output from the C++ parser here - you must specify a compiled xref file.
Boolean flag, which if set causes extra links to be inserted to the ScopePages entry for each declaration in the AST. Note that some declarations might not be in the AST, f.ex. if they are local variables.
Creates a single page with all inheritance graphs as embedded images using dot (graphviz) to create the graphs. Classes that have no subclasses or superclasses are not shown for brevity.
The follwing options are available. They must be set in the InheritanceGraph sub-object:
A string direction to use for laying out the graph nodes. The default is 'vertical', but setting this to 'horizontal' causes the hierarchies to be laid out left-to-right. This can be useful if you have a relatively "flat" class hierarchy that otherwise is much wider than most browser windows.
Creates a single page with the entire object hierarchy in a tree structure. This page is a text-only alternative to the InheritanceGraph page, but both can be used without problems.