def setup(app): from sphinx.util.docfields import Field, TypedField increase_python_stack() # the :ghci-cmd: directive used in ghci.rst app.add_object_type('ghci-cmd', 'ghci-cmd', parse_node=parse_ghci_cmd, objname='GHCi command', indextemplate='pair: %s; GHCi command') app.add_object_type('ghc-flag', 'ghc-flag', objname='GHC command-line option', parse_node=parse_flag, indextemplate='pair: %s; GHC option', doc_field_types=[ Field('since', label='Introduced in GHC version', names=['since']), Field('default', label='Default value', names=['default']), Field('static') ]) app.add_object_type('rts-flag', 'rts-flag', objname='runtime system command-line option', parse_node=parse_flag, indextemplate='pair: %s; RTS option', doc_field_types=[ Field('since', label='Introduced in GHC version', names=['since']), ]) cabaldomain.setup(app)