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