@ -21,9 +21,11 @@ import sys
from os import listdir
from os import listdir
from os . path import isfile , join , isdir , relpath
from os . path import isfile , join , isdir , relpath
#import sys
currentDir = ' @CMAKE_CURRENT_SOURCE_DIR@ '
currentDir = ' @CMAKE_CURRENT_SOURCE_DIR@ '
if currentDir . startswith ( ' @ ' ) :
# Not running in CMake
currentDir = ' . '
def makeIncludeAll ( directory , extension ) :
def makeIncludeAll ( directory , extension ) :
outputFile = join ( directory , ' include-all.rst ' )
outputFile = join ( directory , ' include-all.rst ' )
@ -90,22 +92,29 @@ author = 'The DFHack Team'
# |version| and |release|, also used in various other places throughout the
# |version| and |release|, also used in various other places throughout the
# built documents.
# built documents.
#def get_version():
def get_version ( default ) :
# """Return the DFHack version string, from CMakeLists.txt"""
""" Return the DFHack version string, from CMakeLists.txt """
# version, release = '', ''
version = release = ' '
# with open('CMakeLists.txt') as f:
try :
# for s in f.readlines():
with open ( ' ../CMakeLists.txt ' ) as f :
# if fnmatch.fnmatch(s.upper(), 'SET(DF_VERSION "?.??.??")\n'):
for s in f . readlines ( ) :
# version = s.upper().replace('SET(DF_VERSION "', '')
if fnmatch . fnmatch ( s . upper ( ) , ' SET(DF_VERSION " ?.??.?? " ) \n ' ) :
# elif fnmatch.fnmatch(s.upper(), 'SET(DFHACK_RELEASE "r*")\n'):
version = s . upper ( ) . replace ( ' SET(DF_VERSION " ' , ' ' )
# release = s.upper().replace('SET(DFHACK_RELEASE "', '').lower()
elif fnmatch . fnmatch ( s . upper ( ) , ' SET(DFHACK_RELEASE " r* " ) \n ' ) :
# return (version + '-' + release).replace('")\n', '')
release = s . upper ( ) . replace ( ' SET(DFHACK_RELEASE " ' , ' ' ) . lower ( )
return ( version + ' - ' + release ) . replace ( ' " ) \n ' , ' ' )
except IOError :
return default
# The short X.Y version.
# The short X.Y version.
version = ' @DFHACK_VERSION@ '
version = ' @DFHACK_VERSION@ '
# The full version, including alpha/beta/rc tags.
# The full version, including alpha/beta/rc tags.
release = ' @DFHACK_VERSION@ '
release = ' @DFHACK_VERSION@ '
if version == ' @DFHACK_VERSION@ ' :
# Not running through CMake...
version = release = get_version ( ' @DFHACK_VERSION@ ' )
# The language for content autogenerated by Sphinx. Refer to documentation
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# for a list of supported languages.
#
#
@ -125,7 +134,7 @@ exclude_patterns = ['docs/_build/*', 'depends/*']
# The reST default role (used for this markup: `text`) to use for all
# The reST default role (used for this markup: `text`) to use for all
# documents.
# documents.
default_role = ' any '
default_role = ' ref '
# If true, '()' will be appended to :func: etc. cross-reference text.
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
#add_function_parentheses = True
@ -134,16 +143,9 @@ default_role = 'any'
# unit titles (such as .. function::).
# unit titles (such as .. function::).
#add_module_names = True
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = ' sphinx '
pygments_style = ' sphinx '
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
#keep_warnings = False
@ -155,12 +157,18 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# a list of builtin themes.
html_theme = ' @SPHINX_THEME@ '
html_theme = ' alabaster '
# Theme options are theme-specific and customize the look and feel of a theme
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# further. For a list of options available for each theme, see the
# documentation.
# documentation.
#html_theme_options = {}
html_theme_options = {
#'logo': 'logo.png',
' github_user ' : ' DFHack ' ,
' github_repo ' : ' dfhack ' ,
' github_button ' : False ,
' travis_button ' : False ,
}
# Add any paths that contain custom themes here, relative to this directory.
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
#html_theme_path = []
@ -170,7 +178,7 @@ html_theme = '@SPHINX_THEME@'
#html_title = None
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
html_short_title = ' DFHack Docs '
# The name of an image file (relative to this directory) to place at the top
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# of the sidebar.
@ -179,12 +187,12 @@ html_theme = '@SPHINX_THEME@'
# The name of an image file (within the static path) to use as favicon of the
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# pixels large.
html_favicon = ' dfhack-icon.ico'
html_favicon = ' styles/ dfhack-icon.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = [ ]
html_static_path = [ ' styles ' ]
# Add any extra paths that contain custom files (such as robots.txt or
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# .htaccess) here, relative to this directory. These files are copied
@ -200,17 +208,24 @@ html_static_path = []
#html_use_smartypants = True
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
html_sidebars = {
' ** ' : [
' about.html ' ,
' localtoc.html ' ,
' relations.html ' ,
' searchbox.html ' ,
]
}
# Additional templates that should be rendered to pages, maps page names to
# Additional templates that should be rendered to pages, maps page names to
# template names.
# template names.
#html_additional_pages = {}
#html_additional_pages = {}
# If false, no module index is generated.
# If false, no module index is generated.
#html_domain_indices = True
html_domain_indices = Fals e
# If false, no index is generated.
# If false, no index is generated.
#html_use_index = Tru e
html_use_index = Fals e
# If true, the index is split into individual pages for each letter.
# If true, the index is split into individual pages for each letter.
#html_split_index = False
#html_split_index = False
@ -238,10 +253,6 @@ html_static_path = []
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
#html_search_language = 'en'
#html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
#html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'
#html_search_scorer = 'scorer.js'