conf.py 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. # -*- coding: utf-8 -*-
  2. #
  3. # pythonguide documentation build configuration file, created by
  4. # sphinx-quickstart on Wed Aug 4 22:51:11 2010.
  5. #
  6. # This file is execfile()d with the current directory set to its containing dir.
  7. #
  8. # Note that not all possible configuration values are present in this
  9. # autogenerated file.
  10. #
  11. # All configuration values have a default; values that are commented out
  12. # serve to show the default.
  13. import datetime
  14. import os
  15. import sys
  16. from pathlib import Path
  17. import json
  18. import dataladhandbook_support
  19. # pull out author list from all-contributors spec
  20. authors = [
  21. c['name'] for c in json.load(
  22. (Path(__file__).parent.parent / '.all-contributorsrc').open()).get(
  23. 'contributors', [])
  24. ]
  25. # If extensions (or modules to document with autodoc) are in another directory,
  26. # add these directories to sys.path here. If the directory is relative to the
  27. # documentation root, use os.path.abspath to make it absolute, like shown here.
  28. sys.path.append(os.path.abspath('_themes'))
  29. # -- General configuration -----------------------------------------------------
  30. # If your documentation needs a minimal Sphinx version, state it here.
  31. #needs_sphinx = '1.0'
  32. # Add any Sphinx extension module names here, as strings. They can be extensions
  33. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  34. extensions = [
  35. 'sphinx.ext.ifconfig',
  36. 'sphinx.ext.todo',
  37. 'sphinx.ext.intersphinx',
  38. 'sphinx.ext.doctest',
  39. 'sphinxcontrib.autorunrecord',
  40. 'sphinxcontrib.rsvgconverter',
  41. 'sphinxcontrib.plantuml',
  42. 'dataladhandbook_support',
  43. ]
  44. # Add any paths that contain templates here, relative to this directory.
  45. templates_path = ['_templates']
  46. # The suffix of source filenames.
  47. source_suffix = '.rst'
  48. # The encoding of source files.
  49. #source_encoding = 'utf-8-sig'
  50. # The master toctree document.
  51. master_doc = 'index'
  52. # General information about the project.
  53. current_year = datetime.datetime.now().year
  54. project = u'datalad-handbook'
  55. copyright = (u'2019-{} CC-BY-SA').format(current_year)
  56. # The version info for the project you're documenting, acts as replacement for
  57. # |version| and |release|, also used in various other places throughout the
  58. # built documents.
  59. #
  60. # The short X.Y version.
  61. version = dataladhandbook_support.__version__
  62. # The full version, including alpha/beta/rc tags.
  63. release = version
  64. # The language for content autogenerated by Sphinx. Refer to documentation
  65. # for a list of supported languages.
  66. #language = None
  67. # There are two options for replacing |today|: either, you set today to some
  68. # non-false value, then it is used:
  69. #today = ''
  70. # Else, today_fmt is used as the format for a strftime call.
  71. #today_fmt = '%B %d, %Y'
  72. # List of patterns, relative to source directory, that match files and
  73. # directories to ignore when looking for source files.
  74. exclude_patterns = [
  75. '_build',
  76. '_themes/*.rst', # Excluded due to README.rst in _themes/
  77. ]
  78. # The reST default role (used for this markup: `text`) to use for all documents.
  79. #default_role = None
  80. # If true, '()' will be appended to :func: etc. cross-reference text.
  81. #add_function_parentheses = True
  82. # If true, the current module name will be prepended to all description
  83. # unit titles (such as .. function::).
  84. #add_module_names = True
  85. # If true, sectionauthor and moduleauthor directives will be shown in the
  86. # output. They are ignored by default.
  87. #show_authors = False
  88. # The name of the Pygments (syntax highlighting) style to use.
  89. pygments_style = 'tango'
  90. # A list of ignored prefixes for module index sorting.
  91. #modindex_common_prefix = []
  92. manpages_url = 'http://docs.datalad.org/generated/man/{page}.html'
  93. # numbered figures for better referencing
  94. numfig = True
  95. numfig_secnum_depth = 1
  96. # convert quotes and dashes into to proper symbols
  97. smartquotes = True
  98. # Trim spaces before footnote references that are necessary for the reST parser
  99. # to recognize the footnote, but do not look too nice in the output.
  100. trim_footnote_reference_space = True
  101. # -- Options for HTML output ---------------------------------------------------
  102. html_baseurl = 'http://handbook.datalad.org/'
  103. # The theme to use for HTML and HTML Help pages. See the documentation for
  104. # a list of builtin themes.
  105. html_theme = 'alabaster'
  106. # Theme options are theme-specific and customize the look and feel of a theme
  107. # further. For a list of options available for each theme, see the
  108. # documentation.
  109. # more options: https://alabaster.readthedocs.io/en/latest/customization.html
  110. html_theme_options = {
  111. 'show_powered_by': False,
  112. 'github_user': 'datalad-handbook',
  113. 'github_repo': 'book',
  114. 'github_banner': True,
  115. 'show_related': True,
  116. # colors
  117. # "DataLad gray"
  118. 'body_text': '#333',
  119. # this is a lighter variant of the "DataLad yellow"
  120. 'note_bg': '#e2eacdff',
  121. # the real "DataLad dark gray"
  122. 'note_border': '#333333ff',
  123. 'fixed_sidebar': True,
  124. 'show_relbar_bottom': True,
  125. }
  126. # Add any paths that contain custom themes here, relative to this directory.
  127. html_theme_path = ['_themes']
  128. # The name for this set of Sphinx documents. If None, it defaults to
  129. # "<project> v<release> documentation".
  130. html_title = 'The DataLad Handbook'
  131. # A shorter title for the navigation bar. Default is the same as html_title.
  132. #html_short_title = None
  133. # The name of an image file (relative to this directory) to place at the top
  134. # of the sidebar.
  135. #html_logo = None
  136. # The name of an image file (within the static path) to use as favicon of the
  137. # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
  138. # pixels large.
  139. #html_favicon = None
  140. # Add any paths that contain custom static files (such as style sheets) here,
  141. # relative to this directory. They are copied after the builtin static files,
  142. # so a file named "default.css" will overwrite the builtin "default.css".
  143. html_static_path = ['_static']
  144. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  145. # using the given strftime format.
  146. #html_last_updated_fmt = '%b %d, %Y'
  147. # Custom sidebar templates, maps document names to template names.
  148. html_sidebars = {
  149. 'index': ['sidebarintro.html', 'sourcelink.html', 'searchbox.html', 'hacks.html'],
  150. '**': ['sidebarlogo.html', 'localtoc.html', 'relations.html',
  151. 'sourcelink.html', 'searchbox.html', 'hacks.html']
  152. }
  153. # Additional templates that should be rendered to pages, maps page names to
  154. # template names.
  155. #html_additional_pages = {}
  156. # If false, no module index is generated.
  157. #html_domain_indices = True
  158. # If false, no index is generated.
  159. #html_use_index = True
  160. # If true, the index is split into individual pages for each letter.
  161. #html_split_index = False
  162. # If true, links to the reST sources are added to the pages.
  163. html_show_sourcelink = False
  164. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  165. html_show_sphinx = False
  166. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  167. #html_show_copyright = True
  168. # If true, an OpenSearch description file will be output, and all pages will
  169. # contain a <link> tag referring to it. The value of this option must be the
  170. # base URL from which the finished HTML is served.
  171. #html_use_opensearch = ''
  172. # This is the file name suffix for HTML files (e.g. ".xhtml").
  173. #html_file_suffix = None
  174. # Output file base name for HTML help builder.
  175. htmlhelp_basename = 'dataladhandbookdoc'
  176. # -- Options for LaTeX output --------------------------------------------------
  177. # Grouping the document tree into LaTeX files. List of tuples
  178. # (source start file, target name, title, author, documentclass [howto/manual]).
  179. latex_documents = [
  180. (
  181. 'index',
  182. 'dataladhandbook.tex',
  183. u'The DataLad Handbook',
  184. u' \\and '.join(a.replace(' ', '~') for a in authors),
  185. 'manual'),
  186. ]
  187. # The name of an image file (relative to this directory) to place at the top of
  188. # the title page.
  189. latex_logo = None
  190. latex_toplevel_sectioning = 'part'
  191. latex_show_pagerefs = True
  192. latex_show_urls = 'footnote'
  193. latex_elements = {
  194. 'papersize': 'a4',
  195. 'pointsize': '11pt',
  196. 'figure_align': 'tbp',
  197. 'preamble': """\
  198. \setcounter{tocdepth}{0}
  199. """,
  200. }
  201. # Documents to append as an appendix to all manuals.
  202. #latex_appendices = []
  203. # If false, no module index is generated.
  204. #latex_domain_indices = True
  205. # -- Options for manual page output --------------------------------------------
  206. # One entry per manual page. List of tuples
  207. # (source start file, name, description, authors, manual section).
  208. man_pages = [
  209. ('index', 'dataladhandbook', u'The DataLad Handbook',
  210. [u'all'], 1)
  211. ]
  212. # -- Options for Epub output ---------------------------------------------------
  213. # Bibliographic Dublin Core info.
  214. epub_title = u'dataladhandbook'
  215. epub_author = u'all'
  216. epub_publisher = u'all'
  217. epub_copyright = u'2019–{}, all'.format(current_year)
  218. # The language of the text. It defaults to the language option
  219. # or en if the language is not set.
  220. #epub_language = ''
  221. # The scheme of the identifier. Typical schemes are ISBN or URL.
  222. #epub_scheme = ''
  223. # The unique identifier of the text. This can be a ISBN number
  224. # or the project homepage.
  225. #epub_identifier = ''
  226. # A unique identification for the text.
  227. #epub_uid = ''
  228. # HTML files that should be inserted before the pages created by sphinx.
  229. # The format is a list of tuples containing the path and title.
  230. #epub_pre_files = []
  231. # HTML files that should be inserted after the pages created by sphinx.
  232. # The format is a list of tuples containing the path and title.
  233. #epub_post_files = []
  234. # A list of files that should not be packed into the epub file.
  235. epub_exclude_files = [
  236. ('search.html', 'Search'),
  237. ]
  238. # The depth of the table of contents in toc.ncx.
  239. #epub_tocdepth = 3
  240. # Allow duplicate toc entries.
  241. #epub_tocdup = True
  242. todo_include_todos = True
  243. intersphinx_mapping = {
  244. 'python': ('https://docs.python.org/3', None),
  245. }
  246. plantuml_output_format = 'svg'
  247. plantuml_latex_output_format = 'pdf'
  248. def setup(app):
  249. app.add_stylesheet('custom.css')