Slicer  4.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
conf.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 #
4 # 3D Slicer documentation build configuration file, created by
5 # sphinx-quickstart on Tue Mar 21 03:07:30 2017.
6 #
7 # This file is execfile()d with the current directory set to its
8 # containing dir.
9 #
10 # Note that not all possible configuration values are present in this
11 # autogenerated file.
12 #
13 # All configuration values have a default; values that are commented out
14 # serve to show the default.
15 
16 # If extensions (or modules to document with autodoc) are in another directory,
17 # add these directories to sys.path here. If the directory is relative to the
18 # documentation root, use os.path.abspath to make it absolute, like shown here.
19 #
20 import os
21 import sys
22 
23 from recommonmark.parser import CommonMarkParser
24 
25 sys.path.insert(0, os.path.abspath('../Base/Python'))
26 sys.path.append(os.path.abspath("./_sphinxext"))
27 
28 
29 # -- General configuration ------------------------------------------------
30 
31 # If your documentation needs a minimal Sphinx version, state it here.
32 #
33 # needs_sphinx = '1.0'
34 
35 # Add any Sphinx extension module names here, as strings. They can be
36 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37 # ones.
38 extensions = [
39  'sphinx.ext.autodoc',
40  'workaround_recommonmark_issue_191',
41  'recommonmark',
42  'sphinx_markdown_tables',
43  'notfound.extension', # Show a better 404 page when an invlid address is entered
44 ]
45 
46 # Add any paths that contain templates here, relative to this directory.
47 templates_path = ['_templates']
48 
49 # The suffix(es) of source filenames.
50 # You can specify multiple suffix as a list of string:
51 #
52 source_suffix = ['.rst', '.md']
53 
54 # The master toctree document.
55 master_doc = 'index'
56 
57 # General information about the project.
58 project = '3D Slicer'
59 copyright = '2020, Slicer Community'
60 author = 'Slicer Community'
61 
62 # The version info for the project you're documenting, acts as replacement for
63 # |version| and |release|, also used in various other places throughout the
64 # built documents.
65 #
66 # The short X.Y version.
67 version = ''
68 # The full version, including alpha/beta/rc tags.
69 release = ''
70 
71 # The language for content autogenerated by Sphinx. Refer to documentation
72 # for a list of supported languages.
73 #
74 # This is also used if you do content translation via gettext catalogs.
75 # Usually you set "language" from the command line for these cases.
76 language = None
77 
78 # List of patterns, relative to source directory, that match files and
79 # directories to ignore when looking for source files.
80 # This patterns also effect to html_static_path and html_extra_path
81 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
82 
83 # Set EXCLUDE_DEVELOPER_GUIDE=True environment variable to exclude developer guide.
84 # It is useful for quicker documentation generation while eiditing user manual.
85 if os.environ.get('EXCLUDE_API_REFERENCE', False) == 'True':
86  print("API reference is excluded from documentation.")
87  exclude_patterns.append('developer_guide/saferef.rst')
88  exclude_patterns.append('developer_guide/teem.rst')
89  exclude_patterns.append('developer_guide/vtkAddon.rst')
90  exclude_patterns.append('developer_guide/vtkITK.rst')
91  exclude_patterns.append('developer_guide/slicer.rst')
92  exclude_patterns.append('developer_guide/mrml.rst')
93 
94 # sphinx-notfound-page
95 # https://github.com/readthedocs/sphinx-notfound-page
96 notfound_context = {
97  'title': 'Page Not Found',
98  'body': '''
99 <h1>Page Not Found</h1>
100 <p>Sorry, we couldn't find that page.</p>
101 <p>Try using the search box or go to the homepage.</p>
102 ''',
103 }
104 
105 # The name of the Pygments (syntax highlighting) style to use.
106 pygments_style = 'sphinx'
107 
108 # If true, `todo` and `todoList` produce output, else they produce nothing.
109 todo_include_todos = False
110 
111 # A string of reStructuredText that will be included at the beginning of every source file that is read.
112 rst_prolog = open('global.rst.in', 'r').read()
113 
114 # If given, this must be the name of an image file (path relative to the configuration directory) that is the logo of the docs.
115 # It is placed at the top of the sidebar; its width should therefore not exceed 200 pixels
116 html_logo = '_static/images/3D-Slicer-Mark.png'
117 
118 # -- Options for HTML output ----------------------------------------------
119 
120 # The theme to use for HTML and HTML Help pages. See the documentation for
121 # a list of builtin themes.
122 #
123 html_theme = 'default'
124 
125 # Theme options are theme-specific and customize the look and feel of a theme
126 # further. For a list of options available for each theme, see the
127 # documentation.
128 #
129 html_theme_options = {
130  # Toc options
131  'includehidden': False,
132 }
133 
134 # Add any paths that contain custom static files (such as style sheets) here,
135 # relative to this directory. They are copied after the builtin static files,
136 # so a file named "default.css" will overwrite the builtin "default.css".
137 html_static_path = ['_static']
138 
139 # These paths are either relative to html_static_path
140 # or fully qualified paths (eg. https://...)
141 html_css_files = [
142  'css/custom.css',
143 ]
144 
145 # -- Options for HTMLHelp output ------------------------------------------
146 
147 # Output file base name for HTML help builder.
148 htmlhelp_basename = '3DSlicerdoc'
149 
150 
151 # -- Options for LaTeX output ---------------------------------------------
152 
153 latex_elements = {
154  # The paper size ('letterpaper' or 'a4paper').
155  #
156  # 'papersize': 'letterpaper',
157 
158  # The font size ('10pt', '11pt' or '12pt').
159  #
160  # 'pointsize': '10pt',
161 
162  # Additional stuff for the LaTeX preamble.
163  #
164  # 'preamble': '',
165 
166  # Latex figure (float) alignment
167  #
168  # 'figure_align': 'htbp',
169 }
170 
171 # Grouping the document tree into LaTeX files. List of tuples
172 # (source start file, target name, title,
173 # author, documentclass [howto, manual, or own class]).
174 latex_documents = [
175  (master_doc, '3DSlicer.tex', '3D Slicer Documentation',
176  'Slicer Community', 'manual'),
177 ]
178 
179 
180 # -- Options for manual page output ---------------------------------------
181 
182 # One entry per manual page. List of tuples
183 # (source start file, name, description, authors, manual section).
184 man_pages = [
185  (master_doc, '3Dslicer', '3D Slicer Documentation',
186  [author], 1)
187 ]
188 
189 
190 # -- Options for Texinfo output -------------------------------------------
191 
192 # Grouping the document tree into Texinfo files. List of tuples
193 # (source start file, target name, title, author,
194 # dir menu entry, description, category)
195 texinfo_documents = [
196  (master_doc, '3DSlicer', '3D Slicer Documentation',
197  author, '3DSlicer', 'One line description of project.',
198  'Miscellaneous'),
199 ]
200 
201 
202 # -- Read The Docs -----------------------------------------------------
203 
204 # on_rtd is whether we are on readthedocs.io
205 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
206 
207 if not on_rtd: # only import and set the theme if we're building docs locally
208  import sphinx_rtd_theme
209  html_theme = 'sphinx_rtd_theme'
210  html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]