GI-DOCGEN(1) User Commands GI-DOCGEN(1)

gi-docgen - a documentation generator using gobject-introspection

gi-docgen COMMAND [OPTION...] GIR_FILE

GI-DocGen is a document generator for GObject-based libraries. GObject is the base type system of the GNOME project. GI-DocGen uses the machine readable introspection data provided by GObject-based libraries in order to generate the API reference of these libraries, as well as other ancillary documentation.

The main gi-docgen executable provides various subcommands to access all its functionality.

All commands have the following options:

do not print details of the current operation
make warnings fatal errors
print command line help

The generate command provides the main functionality of gi-docgen.

gi-docgen generate [ OPTIONS ] [ GIR_FILE ]

The generate command will parse the given GIR file, as well as its dependencies, and build an API reference for the namespace it finds in the introspection data. Projects can use a configuration file to control aspects of the output, as well as provide additional content that should be included in the documentation.

use the given project configuration file
specify the directory where the content files listed in the project configuration file can be found
specify the directory where the templates used to generate the documentation can be found
specify the template name to be used when generating the documentation, overriding the project's configuration
create the documentation under the given directory
generate all documentation files directly under the output directory, instead of creating a directory using the namespace name and version
add a directory to the path which the scanner uses to find GIR files. Can be used multiple times to specify multiple directories
generate the documentation only for the given section. Can be used multiple times to specify multiple sections. The supported sections are aliases, bitfields, classes, domains, enums, interfaces, structs and unions. Special values are all, meaning all sections (the default); and none, meaning no section
parse the GIR_FILE without generating the documentation

The gen-index command generates an index of symbols and terms that can be used to search inside the documentation generated by gi-docgen.

gi-docgen gen-index [ OPTIONS ] [ GIR_FILE ]

The generated index is a JSON formatted file is called index.json.

use the given project configuration file
specify the directory where the content files listed in the project configuration file can be found
create the index under the given directory
add a directory to the path which the scanner uses to find GIR files. Can be used multiple times to specify multiple directories
parse the GIR_FILE without generating the documentation

The check command runs a series of checks on the introspection file, to verify that public API is properly documented. It can be used as part of a test suite.

gi-docgen check [ OPTIONS ] [ GIR_FILE ]

use the given project configuration file
add a directory to the path which the scanner uses to find GIR files. Can be used multiple times to specify multiple directories

The serve command generates an API reference and serves it using a local HTTP server.

gi-docgen serve [ OPTIONS ] [ GIR_FILE ]

The serve command will parse the given GIR file, as well as its dependencies, and build an API reference for the namespace it finds in the introspection data. Once the reference has been built successfully, gi-docgen will start a local HTTP server pointing at the output directory.

use the given address for the HTTP server; the default is 127.0.0.1
use the given port for the HTTP server; the default is 8080

The help command prints out the command line help. If you don't specify any command or option when invoking gi-docgen, the help command will be implied.

gi-docgen help [ OPTIONS ] [ COMMAND ]

If no command is specified, help will print out the list of commands.

If a command is specified, help will print out the command line help for that program.

print out the version of gi-docgen

0
The command was successful.
1
Error, or warning, was generated.

The gi-docgen executable uses the XDG_DATA_DIRS and XDG_DATA_HOME environment variables to search for introspection data included in the GIR file.

If the GIDOCGEN_DEBUG environment variable is set, gi-docgen will print out additional messages, which can be helpful when debugging issues.

GI-DocGen: http://gnome.pages.gitlab.gnome.org/gi-docgen/

GObject-Introspection: https://gi.readthedocs.org/

GObject: https://developer.gnome.org/gobject/

gi-docgen 2021.3