]> git.notmuchmail.org Git - notmuch/blob - doc/conf.py
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / doc / conf.py
1
2 # -*- coding: utf-8 -*-
3
4 import sys
5 import os
6
7 extensions = [ 'sphinx.ext.autodoc' ]
8
9 # The suffix of source filenames.
10 source_suffix = '.rst'
11
12 # The master toctree document.
13 master_doc = 'index'
14
15 # General information about the project.
16 project = u'notmuch'
17 copyright = u'2009-2020, Carl Worth and many others'
18
19 location = os.path.dirname(__file__)
20
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','')
26
27 # for autodoc
28 sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 'notmuch2'))
29
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()))
36
37 # The full version, including alpha/beta/rc tags.
38 release = version
39
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']
43
44 if tags.has('WITH_EMACS'):
45     # Hacky reimplementation of include to workaround limitations of
46     # sphinx-doc
47     lines = ['.. include:: /../emacs/rstdoc.rsti\n\n'] # in the source tree
48     for file in ('notmuch.rsti', 'notmuch-lib.rsti', 'notmuch-show.rsti', 'notmuch-tag.rsti'):
49         lines.extend(open(rsti_dir+'/'+file))
50     rst_epilog = ''.join(lines)
51     del lines
52 else:
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')
57
58 if not tags.has('WITH_PYTHON'):
59     exclude_patterns.append('python-bindings.rst')
60
61 # The name of the Pygments (syntax highlighting) style to use.
62 pygments_style = 'sphinx'
63
64 # -- Options for HTML output ----------------------------------------------
65
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'
69
70
71 # Add any paths that contain custom static files (such as style sheets) here,
72 # relative to this directory. They are copied after the builtin static files,
73 # so a file named "default.css" will overwrite the builtin "default.css".
74 html_static_path = []
75
76 # Output file base name for HTML help builder.
77 htmlhelp_basename = 'notmuchdoc'
78
79 # Disable SmartyPants, as it mangles command lines.
80 # Despite the name, this actually affects manual pages as well.
81 html_use_smartypants = False
82
83 # -- Options for manual page output ---------------------------------------
84
85 # One entry per manual page. List of tuples
86 # (source start file, name, description, authors, manual section).
87
88 notmuch_authors = u'Carl Worth and many others'
89
90 man_pages = [
91     ('man1/notmuch', 'notmuch',
92      u'thread-based email index, search, and tagging',
93      [notmuch_authors], 1),
94
95     ('man1/notmuch-address', 'notmuch-address',
96      u'output addresses from matching messages',
97      [notmuch_authors], 1),
98
99     ('man1/notmuch-compact', 'notmuch-compact',
100      u'compact the notmuch database',
101      [notmuch_authors], 1),
102
103     ('man1/notmuch-config', 'notmuch-config',
104      u'access notmuch configuration file',
105      [notmuch_authors], 1),
106
107     ('man1/notmuch-count', 'notmuch-count',
108      u'count messages matching the given search terms',
109      [notmuch_authors], 1),
110
111     ('man1/notmuch-dump', 'notmuch-dump',
112      u'creates a plain-text dump of the tags of each message',
113      [notmuch_authors], 1),
114
115     ('man1/notmuch-emacs-mua', 'notmuch-emacs-mua',
116      u'send mail with notmuch and emacs',
117      [notmuch_authors], 1),
118
119     ('man5/notmuch-hooks', 'notmuch-hooks',
120      u'hooks for notmuch',
121      [notmuch_authors], 5),
122
123     ('man1/notmuch-insert', 'notmuch-insert',
124      u'add a message to the maildir and notmuch database',
125      [notmuch_authors], 1),
126
127     ('man1/notmuch-new', 'notmuch-new',
128      u'incorporate new mail into the notmuch database',
129      [notmuch_authors], 1),
130
131     ('man7/notmuch-properties', 'notmuch-properties',
132      u'notmuch message property conventions and documentation',
133      [notmuch_authors], 7),
134
135     ('man1/notmuch-reindex', 'notmuch-reindex',
136      u're-index matching messages',
137      [notmuch_authors], 1),
138
139     ('man1/notmuch-reply', 'notmuch-reply',
140      u'constructs a reply template for a set of messages',
141      [notmuch_authors], 1),
142
143     ('man1/notmuch-restore', 'notmuch-restore',
144      u'restores the tags from the given file (see notmuch dump)',
145      [notmuch_authors], 1),
146
147     ('man1/notmuch-search', 'notmuch-search',
148      u'search for messages matching the given search terms',
149      [notmuch_authors], 1),
150
151     ('man7/notmuch-search-terms', 'notmuch-search-terms',
152      u'syntax for notmuch queries',
153      [notmuch_authors], 7),
154
155     ('man1/notmuch-show', 'notmuch-show',
156      u'show messages matching the given search terms',
157      [notmuch_authors], 1),
158
159     ('man1/notmuch-tag', 'notmuch-tag',
160      u'add/remove tags for all messages matching the search terms',
161      [notmuch_authors], 1),
162 ]
163
164 # If true, show URL addresses after external links.
165 #man_show_urls = False
166
167 # -- Options for Texinfo output -------------------------------------------
168
169 # Grouping the document tree into Texinfo files. List of tuples
170 # (source start file, target name, title, author,
171 #  dir menu entry, description, category)
172 # If true, do not generate a @detailmenu in the "Top" node's menu.
173 texinfo_no_detailmenu = True
174
175 texinfo_documents = [
176     ('notmuch-emacs', 'notmuch-emacs', u'notmuch-emacs documentation',
177      notmuch_authors, 'notmuch-emacs',
178      'emacs based front-end for notmuch', 'Miscellaneous'),
179 ]
180
181 # generate texinfo list from man page list
182 texinfo_documents += [
183     (
184         x[0],                           # source start file
185         x[1],                           # target name
186         x[1] + u' documentation',       # title
187         x[3][0],                        # author
188         x[1],                           # dir menu entry
189         x[2],                           # description
190         'Miscellaneous'                 # category
191     ) for x in man_pages]