]> git.cworth.org Git - notmuch/blobdiff - doc/conf.py
doc: define and use semantic markup for configuration items
[notmuch] / doc / conf.py
index 1fbd102bd30c23029fddf8f9d0c265f00544b584..6afeac06e53d4da8d6123ecb7c3b1ac55d2ff891 100644 (file)
@@ -14,7 +14,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'notmuch'
-copyright = u'2009-2021, Carl Worth and many others'
+copyright = u'2009-2022, Carl Worth and many others'
 
 location = os.path.dirname(__file__)
 
@@ -25,7 +25,7 @@ for pathdir in ['.', '..']:
             version=infile.read().replace('\n','')
 
 # for autodoc
-sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 'notmuch2'))
+sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 'build', 'stage'))
 
 # read generated config
 for pathdir in ['.', '..']:
@@ -200,3 +200,10 @@ texinfo_documents += [
         x[2],                          # description
         'Miscellaneous'                        # category
     ) for x in man_pages]
+
+def setup(app):
+    import docutils.nodes
+    # define nmconfig role and directive for config items.
+    app.add_object_type('nmconfig','nmconfig',
+                        indextemplate='pair: configuration item; %s',
+                        ref_nodeclass=docutils.nodes.generated)