Function Reference: classdef_texi2html

pkg-octave-doc: classdef_texi2html (clsname, pkgfcns, info)

Generate HTML page for a class definition.

classdef_texi2html requires three input arguments: clsname, a char string with the class’ name; pkgfcns, a cell array with all available functions of a package; and info, a structure with relevant information about the package, which the function clsname belongs to.

pkgfcns can be either a Nx2 or a Nx3 cell array, whose 1st column list all available function names, the 2nd column list the each function’s category, and the 3rd column contains the URL to the function’s source code. pkgfcns is used to create relative references to other pages of functions which are listed in the seealso tag. When a third column is present, classdef_texi2html uses it to add a source code link of the the function in clsname.

The info structure requires at least the following fields:

Field NameDescription
PKG_ICONThe relative reference to the package’s logo image which must be either in .svg or .png format and it is located in the newly created assets/ folder inside the working directory.
PKG_NAMEThe package’s name (e.g. "pkg-octave-doc")
PKG_TITLEThe package’s title (e.g. "Octave Package Documentation")
OCTAVE_LOGOThe relative reference to Octave’s logo, also located inside the assets/ folder.

Source Code: classdef_texi2html

To generate a suitable Nx2 cell array for a specific package, use the package_texi2html function and to populate is with the 3rd column use find_GHurls. The info structure can also be created with package_texi2html.

Layout: grouped vs. lumped methods

The class is rendered in one of two layouts, chosen automatically from the class source:

  • A lumped classdef (the default) becomes a single page: the class help and its properties, then the constructor and one collapsible block per public method, each holding that method’s help and demos.
  • A grouped classdef – one whose methods are organised into named groups by banner comment blocks (see below) – becomes a main page with the class help, the properties, and one collapsible block per group. Each group lists its methods, each with a one-line description, linking to a standalone Class.method.html page. Every public method (the constructor included) gets such a page, laid out like a function page but with a class-scoped sidebar (the groups and their methods) and a breadcrumb back to the package index and the class page; its source-code link points to the class source file.

A class counts as grouped when – and only when – its source holds at least one method-group banner; this is never decided by the class’ size or line count. A banner is a comment block of the form

 
 ################################################################
 ##                     ** Group Name **                       ##
 ################################################################

placed before a methods block, matching the convention used by the datatypes package. Each public method is assigned to the most recent banner above its definition; groups whose methods are all non-public (Hidden or private) are omitted, and any public method before the first banner is collected under an "Other" group.

The generated HTML is based on the classdef_template.html and default.html layouts; a grouped classdef additionally uses group_template.html for the method groups and methodpage_template.html for the per-method pages.

See also: package_texi2html, function_texi2html, find_GHurls, build_DEMOS

Source Code: classdef_texi2html