blob: 2102bb438c518c4ed117d5fe1d197aea30f0af27 (
plain)
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
|
import os
__version__ = "0.0.8"
def get_path():
"""
Shortcut for users whose theme is next to their conf.py.
"""
# Theme directory is defined as our parent directory
return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_context(app, pagename, templatename, context, doctree):
context["tyrian_version"] = __version__
def setup(app):
# add_html_theme is new in Sphinx 1.6+
if hasattr(app, "add_html_theme"):
theme_path = os.path.abspath(os.path.dirname(__file__))
app.add_html_theme("tyrian_sphinx_theme", theme_path)
app.connect("html-page-context", update_context)
return {"version": __version__, "parallel_read_safe": True}
|