/
conf.py
71 lines (63 loc) · 2.06 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
html_theme = 'sphinx_rtd_theme'
extensions = [
'sphinx.ext.mathjax',
'sphinx.ext.graphviz',
'hieroglyph',
]
master_doc = 'index'
default_role = 'obj'
project = u'rbt-proto'
html_title = u'Querying with Combinators'
author = u'Prometheus Research LLC'
copyright = u'2015, Prometheus Research LLC'
version = '2015'
release = '2015'
html_static_path = ['_static']
templates_path = ['_templates']
exclude_patterns = ['_build']
pygments_style = 'sphinx'
latex_elements = {
'preamble': r'''
%\usepackage[doublespacing]{setspace}
\DeclareUnicodeCharacter{22EE}{$\vdots$}
''',
'pointsize': '12pt',
}
latex_documents = [
(master_doc, 'rbt-proto.tex', html_title, author, 'howto', False),
]
slide_theme = 'slides2'
slide_theme_options = {
'custom_css': 'slides.css',
}
autoslides = False
slides_in_html = True
if 'slides_in_html' in tags:
slides_in_html = False
def setup(app):
app.add_config_value('slides_in_html', False, 'html')
app.connect('html-collect-pages', _build_slides)
from sphinx.builders.html import StandaloneHTMLBuilder
original_script_files = StandaloneHTMLBuilder.script_files[:]
original_css_files = StandaloneHTMLBuilder.css_files[:]
def _build_slides(app):
if app.builder.format != 'html' or not app.config.slides_in_html:
return []
current_script_files = StandaloneHTMLBuilder.script_files
current_css_files = StandaloneHTMLBuilder.css_files
StandaloneHTMLBuilder.script_files = original_script_files
StandaloneHTMLBuilder.css_files = original_css_files
from sphinx.application import Sphinx
slides_dir = os.path.join(app.outdir, '_slides')
slides_app = Sphinx(
app.srcdir, app.confdir, slides_dir, app.doctreedir, 'slides',
status=None, warning=app._warning,
warningiserror=app.warningiserror,
tags=['slides_in_html'])
slides_app.build()
StandaloneHTMLBuilder.script_files = current_script_files
StandaloneHTMLBuilder.css_files = current_css_files
return []