2 # -*- coding: utf-8 -*-
7 extensions = [ 'sphinx.ext.autodoc' ]
9 # The suffix of source filenames.
10 source_suffix = '.rst'
12 # The master toctree document.
15 # General information about the project.
17 copyright = u'2009-2022, Carl Worth and many others'
19 location = os.path.dirname(__file__)
21 for pathdir in ['.', '..']:
22 version_file = os.path.join(location,pathdir,'version.txt')
23 if os.path.exists(version_file):
24 with open(version_file,'r') as infile:
25 version=infile.read().replace('\n','')
28 sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 'build', 'stage'))
30 # read generated config
31 for pathdir in ['.', '..']:
32 conf_file = os.path.join(location,pathdir,'sphinx.config')
33 if os.path.exists(conf_file):
34 with open(conf_file,'r') as infile:
35 exec(''.join(infile.readlines()))
37 # The full version, including alpha/beta/rc tags.
40 # List of patterns, relative to source directory, that match files and
41 # directories to ignore when looking for source files.
42 exclude_patterns = ['_build']
44 if tags.has('WITH_EMACS'):
45 # Hacky reimplementation of include to workaround limitations of
47 lines = ['.. include:: /../emacs/rstdoc.rsti\n\n'] # in the source tree
48 for file in ('notmuch.rsti', 'notmuch-lib.rsti', 'notmuch-hello.rsti', 'notmuch-show.rsti', 'notmuch-tag.rsti', 'notmuch-tree.rsti'):
49 lines.extend(open(rsti_dir+'/'+file))
50 rst_epilog = ''.join(lines)
53 # If we don't have emacs (or the user configured --without-emacs),
54 # don't build the notmuch-emacs docs, as they need emacs to generate
55 # the docstring include files
56 exclude_patterns.append('notmuch-emacs.rst')
58 if not tags.has('WITH_PYTHON'):
59 exclude_patterns.append('python-bindings.rst')
61 # The name of the Pygments (syntax highlighting) style to use.
62 pygments_style = 'sphinx'
64 # -- Options for HTML output ----------------------------------------------
66 # The theme to use for HTML and HTML Help pages. See the documentation for
67 # a list of builtin themes.
68 html_theme = 'default'
70 # prevent generation of python module index
71 html_domain_indices=[]
73 # Add any paths that contain custom static files (such as style sheets) here,
74 # relative to this directory. They are copied after the builtin static files,
75 # so a file named "default.css" will overwrite the builtin "default.css".
78 # Output file base name for HTML help builder.
79 htmlhelp_basename = 'notmuchdoc'
81 # Disable SmartyPants, as it mangles command lines.
82 # Despite the name, this actually affects manual pages as well.
83 html_use_smartypants = False
86 # - https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-manpages_url
87 # - https://manpages.debian.org/
88 manpages_url = 'https://manpages.debian.org/{page}.{section}.html'
90 # -- Options for manual page output ---------------------------------------
92 # One entry per manual page. List of tuples
93 # (source start file, name, description, authors, manual section).
95 notmuch_authors = u'Carl Worth and many others'
97 man_make_section_directory = False
100 ('man1/notmuch', 'notmuch',
101 u'thread-based email index, search, and tagging',
102 [notmuch_authors], 1),
104 ('man1/notmuch-address', 'notmuch-address',
105 u'output addresses from matching messages',
106 [notmuch_authors], 1),
108 ('man1/notmuch-compact', 'notmuch-compact',
109 u'compact the notmuch database',
110 [notmuch_authors], 1),
112 ('man1/notmuch-config', 'notmuch-config',
113 u'access notmuch configuration file',
114 [notmuch_authors], 1),
116 ('man1/notmuch-count', 'notmuch-count',
117 u'count messages matching the given search terms',
118 [notmuch_authors], 1),
120 ('man1/notmuch-dump', 'notmuch-dump',
121 u'creates a plain-text dump of the tags of each message',
122 [notmuch_authors], 1),
124 ('man1/notmuch-emacs-mua', 'notmuch-emacs-mua',
125 u'send mail with notmuch and emacs',
126 [notmuch_authors], 1),
128 ('man1/notmuch-git', 'notmuch-git',
129 u'manage notmuch tags with git',
130 [notmuch_authors], 1),
132 ('man1/notmuch-git', 'nmbug',
133 u'manage notmuch bugs with git',
134 [notmuch_authors], 1),
136 ('man5/notmuch-hooks', 'notmuch-hooks',
137 u'hooks for notmuch',
138 [notmuch_authors], 5),
140 ('man1/notmuch-insert', 'notmuch-insert',
141 u'add a message to the maildir and notmuch database',
142 [notmuch_authors], 1),
144 ('man1/notmuch-new', 'notmuch-new',
145 u'incorporate new mail into the notmuch database',
146 [notmuch_authors], 1),
148 ('man7/notmuch-properties', 'notmuch-properties',
149 u'notmuch message property conventions and documentation',
150 [notmuch_authors], 7),
152 ('man1/notmuch-reindex', 'notmuch-reindex',
153 u're-index matching messages',
154 [notmuch_authors], 1),
156 ('man1/notmuch-reply', 'notmuch-reply',
157 u'constructs a reply template for a set of messages',
158 [notmuch_authors], 1),
160 ('man1/notmuch-restore', 'notmuch-restore',
161 u'restores the tags from the given file (see notmuch dump)',
162 [notmuch_authors], 1),
164 ('man1/notmuch-search', 'notmuch-search',
165 u'search for messages matching the given search terms',
166 [notmuch_authors], 1),
168 ('man7/notmuch-search-terms', 'notmuch-search-terms',
169 u'syntax for notmuch queries',
170 [notmuch_authors], 7),
172 ('man1/notmuch', 'notmuch-setup',
173 u'getting started with notmuch',
174 [notmuch_authors], 1),
176 ('man7/notmuch-sexp-queries', 'notmuch-sexp-queries',
177 u's-expression syntax for notmuch queries',
178 [notmuch_authors], 7),
180 ('man1/notmuch-show', 'notmuch-show',
181 u'show messages matching the given search terms',
182 [notmuch_authors], 1),
184 ('man1/notmuch-tag', 'notmuch-tag',
185 u'add/remove tags for all messages matching the search terms',
186 [notmuch_authors], 1),
189 # If true, show URL addresses after external links.
190 #man_show_urls = False
192 # -- Options for Texinfo output -------------------------------------------
194 # Grouping the document tree into Texinfo files. List of tuples
195 # (source start file, target name, title, author,
196 # dir menu entry, description, category)
197 # If true, do not generate a @detailmenu in the "Top" node's menu.
198 texinfo_no_detailmenu = True
200 texinfo_documents = [
201 ('notmuch-emacs', 'notmuch-emacs', u'notmuch-emacs documentation',
202 notmuch_authors, 'notmuch-emacs',
203 'emacs based front-end for notmuch', 'Miscellaneous'),
206 # generate texinfo list from man page list
207 texinfo_documents += [
209 x[0], # source start file
211 x[1] + u' documentation', # title
213 x[1], # dir menu entry
215 'Miscellaneous' # category
216 ) for x in man_pages]
219 import docutils.nodes
220 # define nmconfig role and directive for config items.
221 app.add_object_type('nmconfig','nmconfig',
222 indextemplate='pair: configuration item; %s',
223 ref_nodeclass=docutils.nodes.generated,
224 objname='config item' )
225 app.add_object_type('emacsvar','emacsvar',
226 indextemplate='pair: Emacs variable; %s',
227 ref_nodeclass=docutils.nodes.generated,
228 objname='Emacs variable')
229 app.add_object_type('emacscmd','emacscmd',
230 indextemplate='pair: Emacs command; %s',
231 ref_nodeclass=docutils.nodes.generated,
232 objname='Emacs command')