Perl Module Output

Since version 1.2.18, doxygen can generate a new output format we have called the "Perl Module output format". It has been designed as an intermediate format that can be used to generate new and customized output without having to modify the doxygen source. Therefore, its purpose is similar to the XML output format that can be also generated by doxygen. The XML output format is more standard, but the Perl Module output format is possibly simpler and easier to use.

The Perl Module output format is still experimental at the moment and could be changed in incompatible ways in future versions, although this should not be very probable. It is also lacking some features of other doxygen backends. However, it can be already used to generate useful output, as shown by the Perl Module-based {\LaTeX} generator.

Please report any bugs or problems you find in the Perl Module backend or the Perl Module-based {\LaTeX} generator to the doxygen issue tracker. Suggestions are welcome as well (see also: How to report a bug).

Usage

When the GENERATE_PERLMOD tag is enabled in the Doxyfile, running doxygen generates a number of files in the perlmod/ subdirectory of your output directory. These files are the following:

  • DoxyDocs.pm: This is the Perl module that actually contains the documentation, in the Perl Module format described below.

  • DoxyModel.pm: This Perl module describes the structure of DoxyDocs.pm, independently of the actual documentation. See below for details.

  • doxyrules.make: This file contains the make rules to build and clean the files that are generated from the Doxyfile. Also contains the paths to those files and other relevant information. This file is intended to be included by your own Makefile.

  • Makefile: This is a simple Makefile including doxyrules.make.

To make use of the documentation stored in DoxyDocs.pm you can use one of the default Perl Module-based generators provided by doxygen (at the moment this includes the Perl Module-based {\LaTeX} generator, see below) or write your own customized generator. This should not be too hard if you have some knowledge of Perl and it's the main purpose of including the Perl Module backend in doxygen. See below for details on how to do this.

Using the LaTeX generator.

The Perl Module-based {\LaTeX} generator is pretty experimental and incomplete at the moment, but you could find it useful nevertheless. It can generate documentation for functions, typedefs and variables within files and classes and can be customized quite a lot by redefining {\TeX} macros. However, there is still no documentation on how to do this.

Setting the PERLMOD_LATEX tag to YES in the Doxyfile enables the creation of some additional files in the perlmod/ subdirectory of your output directory. These files contain the Perl scripts and {\LaTeX} code necessary to generate PDF and DVI output from the Perl Module output, using pdflatex and latex respectively. Rules to automate the use of these files are also added to doxyrules.make and the Makefile.

The additional generated files are the following:

  • doxylatex.pl: This Perl script uses DoxyDocs.pm and DoxyModel.pm to generate doxydocs.tex, a {\TeX} file containing the documentation in a format that can be accessed by {\LaTeX} code. This file is not directly LaTeXable.

  • doxyformat.tex: This file contains the {\LaTeX} code that transforms the documentation from doxydocs.tex into {\LaTeX} text suitable to be {\LaTeX} 'ed and presented to the user.

  • doxylatex-template.pl: This Perl script uses DoxyModel.pm to generate doxytemplate.tex, a {\TeX} file defining default values for some macros. doxytemplate.tex is included by doxyformat.tex to avoid the need of explicitly defining some macros.

  • doxylatex.tex: This is a very simple {\LaTeX} document that loads some packages and includes doxyformat.tex and doxydocs.tex. This document is {\LaTeX} 'ed to produce the PDF and DVI documentation by the rules added to doxyrules.make.

Creation of PDF and DVI output

To try this you need to have installed latex, pdflatex and the packages used by doxylatex.tex.

  1. Update your Doxyfile to the latest version using:

    doxygen -u Doxyfile

  2. Set both GENERATE_PERLMOD and PERLMOD_LATEX tags to YES in your Doxyfile.

  3. Run doxygen on your Doxyfile:

    doxygen Doxyfile

  4. A perlmod/ subdirectory should have appeared in your output directory. Enter the perlmod/ subdirectory and run:

    make pdf

    This should generate a doxylatex.pdf with the documentation in PDF format.

  5. Run:

    make dvi

    This should generate a doxylatex.dvi with the documentation in DVI format.

Documentation format.

The Perl Module documentation generated by doxygen is stored in DoxyDocs.pm. This is a very simple Perl module that contains only two statements: an assignment to the variable $doxydocs and the customary 1; statement which usually ends Perl modules.
The documentation is stored in the variable $doxydocs, which can then be accessed by a Perl script using DoxyDocs.pm.

$doxydocs contains a tree-like structure composed of three types of nodes: strings, hashes and lists.

  • Strings: These are normal Perl strings. They can be of any length can contain any character. Their semantics depends on their location within the tree. This type of node has no children.

  • Hashes: These are references to anonymous Perl hashes. A hash can have multiple fields, each with a different key. The value of a hash field can be a string, a hash or a list, and its semantics depends on the key of the hash field and the location of the hash within the tree. The values of the hash fields are the children of the node.

  • Lists: These are references to anonymous Perl lists. A list has an undefined number of elements, which are the children of the node. Each element has the same type (string, hash or list) and the same semantics, depending on the location of the list within the tree.

As you can see, the documentation contained in $doxydocs does not present any special impediment to be processed by a simple Perl script.

Data structure

You might be interested in processing the documentation contained in DoxyDocs.pm without needing to take into account the semantics of each node of the documentation tree. For this purpose, doxygen generates a DoxyModel.pm file which contains a data structure describing the type and children of each node in the documentation tree.

The rest of this section is to be written yet, but in the meantime you can look at the Perl scripts generated by doxygen (such as doxylatex.pl or doxytemplate-latex.pl) to get an idea on how to use DoxyModel.pm.

Perl Module Tree Nodes

Nodes in the documentation tree of the Perl Module output format.

This is a description of the structure of the documentation tree in DoxyDocs.pm. Each item in the list below describes a node in the tree, and the format of the description is as follows:

  • [ key => ] Name (type). Explanation of the content.

Where

  • The "key =>" part only appears if the parent node is a hash. "key" is the key for this node.

  • "Name" is a unique name for the node, defined in DoxyModel.pm.

  • "(type)" is the type of the node: "string" for string nodes, "hash" for hash nodes, "list" for list nodes, and "doc" for documentation subtrees. The structure of documentation subtrees is not described anywhere yet, but you can look for example at doxylatex.pl to see how to process it.

The meaning of each node in the documentation tree is as follows:

  • Root (hash). Root node.
    • classes => Classes (list). Documented classes.
      • Class (hash). A documented class.
        • protected_members => ClassProtectedMembers (hash). Information about the protected members in the class.
          • members => ClassProtectedMemberList (list). protected member list.
            • ClassProtectedMember (hash). A protected member.
              • protection => ClassProtectedMemberProtection (string). Protection of the protected member.
              • detailed => ClassProtectedMemberDetailed (hash). Detailed information about the protected member.
                • doc => ClassProtectedMemberDetailedDoc (doc). Detailed documentation for the protected member.
                • see => ClassProtectedMemberSee (doc). "See also" documentation for the protected member.
              • kind => ClassProtectedMemberKind (string). Kind of protected member (usually "variable").
              • name => ClassProtectedMemberName (string). Name of the protected member.
              • type => ClassProtectedMemberType (string). Data type of the protected member.
        • detailed => ClassDetailed (hash). Detailed information about the class.
          • doc => ClassDetailedDoc (doc). Detailed documentation block for the class.
        • protected_typedefs => ClassProtectedTypedefs (hash). Information about the protected typedefs in the class.
          • members => ClassProtectedTypedefList (list). protected typedef list.
            • ClassProtectedTypedef (hash). A protected typedef.
              • protection => ClassProtectedTypedefProtection (string). Protection of the protected typedef.
              • detailed => ClassProtectedTypedefDetailed (hash). Detailed information about the protected typedef.
                • doc => ClassProtectedTypedefDetailedDoc (doc). Detailed documentation for the protected typedef.
                • see => ClassProtectedTypedefSee (doc). "See also" documentation for the protected typedef.
              • kind => ClassProtectedTypedefKind (string). Kind of protected typedef (usually "typedef").
              • name => ClassProtectedTypedefName (string). Name of the protected typedef.
              • type => ClassProtectedTypedefType (string). Data type of the protected typedef.
        • name => ClassName (string). Name of the class.
        • private_members => ClassPrivateMembers (hash). Information about the private members in the class.
          • members => ClassPrivateMemberList (list). private member list.
            • ClassPrivateMember (hash). A private member.
              • protection => ClassPrivateMemberProtection (string). Protection of the private member.
              • detailed => ClassPrivateMemberDetailed (hash). Detailed information about the private member.
                • doc => ClassPrivateMemberDetailedDoc (doc). Detailed documentation for the private member.
                • see => ClassPrivateMemberSee (doc). "See also" documentation for the private member.
              • kind => ClassPrivateMemberKind (string). Kind of private member (usually "variable").
              • name => ClassPrivateMemberName (string). Name of the private member.
              • type => ClassPrivateMemberType (string). Data type of the private member.
        • private_typedefs => ClassPrivateTypedefs (hash). Information about the private typedefs in the class.
          • members => ClassPrivateTypedefList (list). private typedef list.
            • ClassPrivateTypedef (hash). A private typedef.
              • protection => ClassPrivateTypedefProtection (string). Protection of the private typedef.
              • detailed => ClassPrivateTypedefDetailed (hash). Detailed information about the private typedef.
                • doc => ClassPrivateTypedefDetailedDoc (doc). Detailed documentation for the private typedef.
                • see => ClassPrivateTypedefSee (doc). "See also" documentation for the private typedef.
              • kind => ClassPrivateTypedefKind (string). Kind of private typedef (usually "typedef").
              • name => ClassPrivateTypedefName (string). Name of the private typedef.
              • type => ClassPrivateTypedefType (string). Data type of the private typedef.
        • protected_methods => ClassProtectedMethods (hash). Information about the protected methods in the class.
          • members => ClassProtectedMethodList (list). protected method list.
            • ClassProtectedMethod (hash). A protected method.
              • parameters => ClassProtectedMethodParams (list). List of the parameters of the protected method.
                • ClassProtectedMethodParam (hash). A parameter of the protected method.
                  • declaration_name => ClassProtectedMethodParamName (string). The name of the parameter.
                  • type => ClassProtectedMethodParamType (string). The data type of the parameter.
              • protection => ClassProtectedMethodProtection (string). Protection of the protected method.
              • virtualness => ClassProtectedMethodVirtualness (string). Virtualness of the protected method.
              • detailed => ClassProtectedMethodDetailed (hash). Detailed information about the protected method.
                • params => ClassProtectedMethodPDBlocks (list). List of parameter documentation blocks for the protected method.
                  • ClassProtectedMethodPDBlock (hash). A parameter documentation block for the protected method.
                    • parameters => ClassProtectedMethodPDParams (list). Parameter list for this parameter documentation block.
                      • ClassProtectedMethodPDParam (hash). A parameter documented by this documentation block.
                        • name => ClassProtectedMethodPDParamName (string). Name of the parameter.
                    • doc => ClassProtectedMethodPDDoc (doc). Documentation for this parameter documentation block.
                • doc => ClassProtectedMethodDetailedDoc (doc). Detailed documentation for the protected method.
                • see => ClassProtectedMethodSee (doc). "See also" documentation for the protected method.
                • return => ClassProtectedMethodReturn (doc). Documentation about the return value of the protected method.
              • kind => ClassProtectedMethodKind (string). Kind of protected method (usually "function").
              • name => ClassProtectedMethodName (string). Name of the protected method.
              • type => ClassProtectedMethodType (string). Data type returned by the protected method.
              • static => ClassProtectedMethodStatic (string). Whether the protected method is static.
        • public_typedefs => ClassPublicTypedefs (hash). Information about the public typedefs in the class.
          • members => ClassPublicTypedefList (list). public typedef list.
            • ClassPublicTypedef (hash). A public typedef.
              • protection => ClassPublicTypedefProtection (string). Protection of the public typedef.
              • detailed => ClassPublicTypedefDetailed (hash). Detailed information about the public typedef.
                • doc => ClassPublicTypedefDetailedDoc (doc). Detailed documentation for the public typedef.
                • see => ClassPublicTypedefSee (doc). "See also" documentation for the public typedef.
              • kind => ClassPublicTypedefKind (string). Kind of public typedef (usually "typedef").
              • name => ClassPublicTypedefName (string). Name of the public typedef.
              • type => ClassPublicTypedefType (string). Data type of the public typedef.
        • public_members => ClassPublicMembers (hash). Information about the public members in the class.
          • members => ClassPublicMemberList (list). public member list.
            • ClassPublicMember (hash). A public member.
              • protection => ClassPublicMemberProtection (string). Protection of the public member.
              • detailed => ClassPublicMemberDetailed (hash). Detailed information about the public member.
                • doc => ClassPublicMemberDetailedDoc (doc). Detailed documentation for the public member.
                • see => ClassPublicMemberSee (doc). "See also" documentation for the public member.
              • kind => ClassPublicMemberKind (string). Kind of public member (usually "variable").
              • name => ClassPublicMemberName (string). Name of the public member.
              • type => ClassPublicMemberType (string). Data type of the public member.
        • private_methods => ClassPrivateMethods (hash). Information about the private methods in the class.
          • members => ClassPrivateMethodList (list). private method list.
            • ClassPrivateMethod (hash). A private method.
              • parameters => ClassPrivateMethodParams (list). List of the parameters of the private method.
                • ClassPrivateMethodParam (hash). A parameter of the private method.
                  • declaration_name => ClassPrivateMethodParamName (string). The name of the parameter.
                  • type => ClassPrivateMethodParamType (string). The data type of the parameter.
              • protection => ClassPrivateMethodProtection (string). Protection of the private method.
              • virtualness => ClassPrivateMethodVirtualness (string). Virtualness of the private method.
              • detailed => ClassPrivateMethodDetailed (hash). Detailed information about the private method.
                • params => ClassPrivateMethodPDBlocks (list). List of parameter documentation blocks for the private method.
                  • ClassPrivateMethodPDBlock (hash). A parameter documentation block for the private method.
                    • parameters => ClassPrivateMethodPDParams (list). Parameter list for this parameter documentation block.
                      • ClassPrivateMethodPDParam (hash). A parameter documented by this documentation block.
                        • name => ClassPrivateMethodPDParamName (string). Name of the parameter.
                    • doc => ClassPrivateMethodPDDoc (doc). Documentation for this parameter documentation block.
                • doc => ClassPrivateMethodDetailedDoc (doc). Detailed documentation for the private method.
                • see => ClassPrivateMethodSee (doc). "See also" documentation for the private method.
                • return => ClassPrivateMethodReturn (doc). Documentation about the return value of the private method.
              • kind => ClassPrivateMethodKind (string). Kind of private method (usually "function").
              • name => ClassPrivateMethodName (string). Name of the private method.
              • type => ClassPrivateMethodType (string). Data type returned by the private method.
              • static => ClassPrivateMethodStatic (string). Whether the private method is static.
        • public_methods => ClassPublicMethods (hash). Information about the public methods in the class.
          • members => ClassPublicMethodList (list). public method list.
            • ClassPublicMethod (hash). A public method.
              • parameters => ClassPublicMethodParams (list). List of the parameters of the public method.
                • ClassPublicMethodParam (hash). A parameter of the public method.
                  • declaration_name => ClassPublicMethodParamName (string). The name of the parameter.
                  • type => ClassPublicMethodParamType (string). The data type of the parameter.
              • protection => ClassPublicMethodProtection (string). Protection of the public method.
              • virtualness => ClassPublicMethodVirtualness (string). Virtualness of the public method.
              • detailed => ClassPublicMethodDetailed (hash). Detailed information about the public method.
                • params => ClassPublicMethodPDBlocks (list). List of parameter documentation blocks for the public method.
                  • ClassPublicMethodPDBlock (hash). A parameter documentation block for the public method.
                    • parameters => ClassPublicMethodPDParams (list). Parameter list for this parameter documentation block.
                      • ClassPublicMethodPDParam (hash). A parameter documented by this documentation block.
                        • name => ClassPublicMethodPDParamName (string). Name of the parameter.
                    • doc => ClassPublicMethodPDDoc (doc). Documentation for this parameter documentation block.
                • doc => ClassPublicMethodDetailedDoc (doc). Detailed documentation for the public method.
                • see => ClassPublicMethodSee (doc). "See also" documentation for the public method.
                • return => ClassPublicMethodReturn (doc). Documentation about the return value of the public method.
              • kind => ClassPublicMethodKind (string). Kind of public method (usually "function").
              • name => ClassPublicMethodName (string). Name of the public method.
              • type => ClassPublicMethodType (string). Data type returned by the public method.
              • static => ClassPublicMethodStatic (string). Whether the public method is static.
    • files => Files (list). Documented files.
      • File (hash). A documented file.
        • detailed => FileDetailed (hash). Detailed information about the file.
          • doc => FileDetailedDoc (doc). Detailed documentation block for the file.
        • functions => FileFunctions (hash). Information about the functions in the file.
          • members => FileFunctionList (list). function list.
            • FileFunction (hash). A function.
              • parameters => FileFunctionParams (list). List of the parameters of the function.
                • FileFunctionParam (hash). A parameter of the function.
                  • declaration_name => FileFunctionParamName (string). The name of the parameter.
                  • type => FileFunctionParamType (string). The data type of the parameter.
              • protection => FileFunctionProtection (string). Protection of the function.
              • virtualness => FileFunctionVirtualness (string). Virtualness of the function.
              • detailed => FileFunctionDetailed (hash). Detailed information about the function.
                • params => FileFunctionPDBlocks (list). List of parameter documentation blocks for the function.
                  • FileFunctionPDBlock (hash). A parameter documentation block for the function.
                    • parameters => FileFunctionPDParams (list). Parameter list for this parameter documentation block.
                      • FileFunctionPDParam (hash). A parameter documented by this documentation block.
                        • name => FileFunctionPDParamName (string). Name of the parameter.
                    • doc => FileFunctionPDDoc (doc). Documentation for this parameter documentation block.
                • doc => FileFunctionDetailedDoc (doc). Detailed documentation for the function.
                • see => FileFunctionSee (doc). "See also" documentation for the function.
                • return => FileFunctionReturn (doc). Documentation about the return value of the function.
              • kind => FileFunctionKind (string). Kind of function (usually "function").
              • name => FileFunctionName (string). Name of the function.
              • type => FileFunctionType (string). Data type returned by the function.
              • static => FileFunctionStatic (string). Whether the function is static.
        • name => FileName (string). Name of the file.
        • variables => FileVariables (hash). Information about the variables in the file.
          • members => FileVariableList (list). variable list.
            • FileVariable (hash). A variable.
              • protection => FileVariableProtection (string). Protection of the variable.
              • detailed => FileVariableDetailed (hash). Detailed information about the variable.
                • doc => FileVariableDetailedDoc (doc). Detailed documentation for the variable.
                • see => FileVariableSee (doc). "See also" documentation for the variable.
              • kind => FileVariableKind (string). Kind of variable (usually "variable").
              • name => FileVariableName (string). Name of the variable.
              • type => FileVariableType (string). Data type of the variable.
        • typedefs => FileTypedefs (hash). Information about the typedefs in the file.
          • members => FileTypedefList (list). typedef list.
            • FileTypedef (hash). A typedef.
              • protection => FileTypedefProtection (string). Protection of the typedef.
              • detailed => FileTypedefDetailed (hash). Detailed information about the typedef.
                • doc => FileTypedefDetailedDoc (doc). Detailed documentation for the typedef.
                • see => FileTypedefSee (doc). "See also" documentation for the typedef.
              • kind => FileTypedefKind (string). Kind of typedef (usually "typedef").
              • name => FileTypedefName (string). Name of the typedef.
              • type => FileTypedefType (string). Data type of the typedef.

Go to the next section or return to the index.