gi-docgen gen-index
Generating the symbols index from introspection data
SYNOPSIS
gi-docgen gen-index [OPTIONS…] [GIRFILE]
DESCRIPTION
The gen-index command generates a symbols index from introspection data. The symbols index can be used to efficiently search symbols and terms.
The generated index file is called index.json
OPTIONS
--add-include--path DIRAdds
DIRto the list of paths used to find introspection data files included in the givenGIRFILE. The default search path for GIR files is$XDG_DATA_DIRS/gir-1.0and$XDG_DATA_HOME/gir-1.0; this option is typically used to include uninstalled GIR files, or non-standard locations.-C, --config FILELoads a project configuration file.
--dry-runOnly load the introspection data, without generating the index.
--content-dir DIRThe directories for extra content, like additional files and images specified in the project configuration file. This argument may be called multiple times to specify several lookup directories, the content files will be looked these directories in the same order they are added.
--output-dir DIRGenerates the index file under
DIR.
INDEX FILE
The index file is in JSON format.
The index file contains a single object with the following members:
meta=objectAn object with metadata about the index.
symbols=array of objectsAn array of all the addressable symbols.
terms=objectA dictionary of all terms.
The meta object contains the following members:
ns=sThe namespace name.
version=sThe namespace version.
generator=sThe
gi-docgenstring.generator-version=sThe version of
gi-docgen.
The symbols array contains objects with the following members:
type=s(mandatory)The type of symbol:
alias,bitfield,callback,class,class_method,ctor,domain,enum,function,function_macro,interface,method,property,signal,type_func,union,vfunc.name=s(mandatory)The name of the symbol.
ctype=sThe base C type for identifiers; only available for types:
alias,bitfield,class,domain,enum,interface,union.type_name=sThe type name related to a symbol; only available for types:
class_method,ctor,method,property,signal,type_func,vfunc.ident=sThe C identifier for symbols; only available for types:
class_method,constant,ctor,function,function_macro,method,type_func.struct_for=sThe C type related to a class structure; only available for the
class_methodtype.
The terms dictonary contains all terms as members; each term is associated
to an array of indices in the symbols array.