示例#1
0
sys.path.insert(0, os.path.abspath('../../'))  #  needed to import pkg
sys.path.insert(0, os.path.abspath('.'))  #  needed to import pkg

if os.getcwd().find('readthedocs') < 0:
    pkg = __import__(os.getcwd().split(os.sep)[-3])
else:
    pkg = __import__(os.getcwd().split(os.sep)[-5])

sys.path.insert(0, os.path.abspath('../../' +
                                   pkg.__name__))  #  needed to import pkg

from auxilium import replacements_from_pkg, replacements, replacements_str

replacements = replacements_from_pkg(replacements, pkg)
rst_prolog = replacements_str(replacements)
print(rst_prolog)

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx_rtd_theme',
    'sphinx.ext.autodoc',
    #'sphinx.ext.autosectionlabel',
示例#2
0
rst_prolog_file = '_static' + os.sep + 'rst_prolog.rst'
if os.path.exists(rst_prolog_file):
    f = open(rst_prolog_file, 'r')
    rst_prolog += os.linesep + f.read()
    f.close()

rst_epilog_file = '_static' + os.sep + 'rst_epilog.rst'
if os.path.exists(rst_epilog_file):
    f = open(rst_epilog_file, 'r')
    rst_epilog += os.linesep + f.read()
    f.close()

# extend rst_prolog with pkg items
_replacements = replacements_from_pkg(replacements, pkg)
rst_prolog += os.linesep + replacements_str(_replacements)

# print(rst_prolog)
# print(rst_epilog)

# -- Options for HTML output ----------------------------------------------

html_theme = 'sphinx_rtd_theme'
html_logo = 'logo.png'
# html_theme_options = {}
# html_static_path = ['_static']

# -- Options for LaTeX output ---------------------------------------------

latex_logo = 'logo.png'
latex_elements = {