2013-03-11 10:40:09 +01:00
|
|
|
|
# vim:fileencoding=utf-8:noet
|
2014-08-31 20:55:26 +02:00
|
|
|
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
2012-12-13 15:43:05 +01:00
|
|
|
|
|
2013-02-08 17:32:23 +01:00
|
|
|
|
import os
|
|
|
|
|
import sys
|
2012-12-13 15:43:05 +01:00
|
|
|
|
|
2014-08-31 20:55:26 +02:00
|
|
|
|
|
2013-03-17 17:20:21 +01:00
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
|
|
|
|
|
sys.path.insert(0, os.path.abspath(os.getcwd()))
|
2012-12-13 15:43:05 +01:00
|
|
|
|
|
2014-10-25 19:31:23 +02:00
|
|
|
|
extensions = [
|
|
|
|
|
'powerline_autodoc', 'powerline_automan',
|
|
|
|
|
'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode',
|
|
|
|
|
]
|
2012-12-13 15:43:05 +01:00
|
|
|
|
source_suffix = '.rst'
|
|
|
|
|
master_doc = 'index'
|
2014-09-14 12:28:52 +02:00
|
|
|
|
project = 'Powerline'
|
2012-12-17 15:24:42 +01:00
|
|
|
|
version = 'beta'
|
|
|
|
|
release = 'beta'
|
2012-12-13 15:43:05 +01:00
|
|
|
|
exclude_patterns = ['_build']
|
|
|
|
|
pygments_style = 'sphinx'
|
2014-10-12 17:37:15 +02:00
|
|
|
|
|
2014-08-13 17:37:11 +02:00
|
|
|
|
html_theme = 'default'
|
2012-12-13 15:43:05 +01:00
|
|
|
|
html_static_path = ['_static']
|
2014-01-25 16:20:06 +01:00
|
|
|
|
html_show_copyright = False
|
|
|
|
|
|
2014-10-12 17:37:15 +02:00
|
|
|
|
latex_show_urls = 'footnote'
|
|
|
|
|
latex_elements = {
|
|
|
|
|
'preamble': '''
|
|
|
|
|
\\DeclareUnicodeCharacter{22EF}{$\\cdots$} % Dots
|
|
|
|
|
\\DeclareUnicodeCharacter{2665}{\\ding{170}} % Heart
|
|
|
|
|
\\DeclareUnicodeCharacter{2746}{\\ding{105}} % Snow
|
|
|
|
|
\\usepackage{pifont}
|
|
|
|
|
''',
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-25 19:31:23 +02:00
|
|
|
|
man_pages = []
|
|
|
|
|
for doc in os.listdir(os.path.join(os.path.dirname(__file__), 'commands')):
|
|
|
|
|
if doc.endswith('.rst'):
|
|
|
|
|
name = doc[:-4]
|
|
|
|
|
module = 'powerline.commands.{0}'.format(name)
|
|
|
|
|
get_argparser = __import__(str(module), fromlist=[str('get_argparser')]).get_argparser
|
|
|
|
|
parser = get_argparser()
|
|
|
|
|
description = parser.description
|
|
|
|
|
man_pages.append([
|
|
|
|
|
'commands/' + name,
|
|
|
|
|
'powerline' if name == 'main' else 'powerline-' + name,
|
|
|
|
|
description,
|
|
|
|
|
'',
|
|
|
|
|
1
|
|
|
|
|
])
|
|
|
|
|
|
2014-01-25 16:20:06 +01:00
|
|
|
|
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
|
|
|
|
|
2014-09-20 15:48:15 +02:00
|
|
|
|
if not on_rtd: # only import and set the theme if we’re building docs locally
|
2014-01-25 16:20:06 +01:00
|
|
|
|
try:
|
|
|
|
|
import sphinx_rtd_theme
|
|
|
|
|
html_theme = 'sphinx_rtd_theme'
|
|
|
|
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
|
|
|
|
except ImportError:
|
|
|
|
|
pass
|
2015-01-09 14:52:01 +01:00
|
|
|
|
|
|
|
|
|
if on_rtd or html_theme == 'sphinx_rtd_theme':
|
|
|
|
|
html_context = {
|
|
|
|
|
'css_files': [
|
|
|
|
|
'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
|
|
|
|
|
'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
|
|
|
|
|
'_static/css/theme_overrides.css',
|
|
|
|
|
],
|
|
|
|
|
}
|