conf.py 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. # This file is execfile()d with the current directory set to its containing dir.
  2. #
  3. # This file only contains a selection of the most common options. For a full
  4. # list see the documentation:
  5. # https://www.sphinx-doc.org/en/master/usage/configuration.html
  6. #
  7. # All configuration values have a default; values that are commented out
  8. # serve to show the default.
  9. import os
  10. import sys
  11. import inspect
  12. import shutil
  13. # -- Path setup --------------------------------------------------------------
  14. __location__ = os.path.join(
  15. os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe()))
  16. )
  17. # If extensions (or modules to document with autodoc) are in another directory,
  18. # add these directories to sys.path here. If the directory is relative to the
  19. # documentation root, use os.path.abspath to make it absolute, like shown here.
  20. sys.path.insert(0, os.path.join(__location__, "../src"))
  21. # -- Run sphinx-apidoc -------------------------------------------------------
  22. # This hack is necessary since RTD does not issue `sphinx-apidoc` before running
  23. # `sphinx-build -b html . _build/html`. See Issue:
  24. # https://github.com/rtfd/readthedocs.org/issues/1139
  25. # DON'T FORGET: Check the box "Install your project inside a virtualenv using
  26. # setup.py install" in the RTD Advanced Settings.
  27. # Additionally it helps us to avoid running apidoc manually
  28. try: # for Sphinx >= 1.7
  29. from sphinx.ext import apidoc
  30. except ImportError:
  31. from sphinx import apidoc
  32. output_dir = os.path.join(__location__, "api")
  33. module_dir = os.path.join(__location__, "../src/rfidacd")
  34. try:
  35. shutil.rmtree(output_dir)
  36. except FileNotFoundError:
  37. pass
  38. try:
  39. import sphinx
  40. cmd_line_template = (
  41. "sphinx-apidoc --implicit-namespaces -f -o {outputdir} {moduledir}"
  42. )
  43. cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir)
  44. args = cmd_line.split(" ")
  45. if tuple(sphinx.__version__.split(".")) >= ("1", "7"):
  46. # This is a rudimentary parse_version to avoid external dependencies
  47. args = args[1:]
  48. apidoc.main(args)
  49. except Exception as e:
  50. print("Running `sphinx-apidoc` failed!\n{}".format(e))
  51. # -- General configuration ---------------------------------------------------
  52. # If your documentation needs a minimal Sphinx version, state it here.
  53. # needs_sphinx = '1.0'
  54. # Add any Sphinx extension module names here, as strings. They can be extensions
  55. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  56. extensions = [
  57. "sphinx.ext.autodoc",
  58. "sphinx.ext.intersphinx",
  59. "sphinx.ext.todo",
  60. "sphinx.ext.autosummary",
  61. "sphinx.ext.viewcode",
  62. "sphinx.ext.coverage",
  63. "sphinx.ext.doctest",
  64. "sphinx.ext.ifconfig",
  65. "sphinx.ext.mathjax",
  66. "sphinx.ext.napoleon",
  67. ]
  68. # Add any paths that contain templates here, relative to this directory.
  69. templates_path = ["_templates"]
  70. # The suffix of source filenames.
  71. source_suffix = ".rst"
  72. # The encoding of source files.
  73. # source_encoding = 'utf-8-sig'
  74. # The master toctree document.
  75. master_doc = "index"
  76. # General information about the project.
  77. project = "rfidacd"
  78. copyright = "2021, Thomas Verchow"
  79. # The version info for the project you're documenting, acts as replacement for
  80. # |version| and |release|, also used in various other places throughout the
  81. # built documents.
  82. #
  83. # The short X.Y version.
  84. version = "" # Is set by calling `setup.py docs`
  85. # The full version, including alpha/beta/rc tags.
  86. release = "" # Is set by calling `setup.py docs`
  87. # The language for content autogenerated by Sphinx. Refer to documentation
  88. # for a list of supported languages.
  89. # language = None
  90. # There are two options for replacing |today|: either, you set today to some
  91. # non-false value, then it is used:
  92. # today = ''
  93. # Else, today_fmt is used as the format for a strftime call.
  94. # today_fmt = '%B %d, %Y'
  95. # List of patterns, relative to source directory, that match files and
  96. # directories to ignore when looking for source files.
  97. exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".venv"]
  98. # The reST default role (used for this markup: `text`) to use for all documents.
  99. # default_role = None
  100. # If true, '()' will be appended to :func: etc. cross-reference text.
  101. # add_function_parentheses = True
  102. # If true, the current module name will be prepended to all description
  103. # unit titles (such as .. function::).
  104. # add_module_names = True
  105. # If true, sectionauthor and moduleauthor directives will be shown in the
  106. # output. They are ignored by default.
  107. # show_authors = False
  108. # The name of the Pygments (syntax highlighting) style to use.
  109. pygments_style = "sphinx"
  110. # A list of ignored prefixes for module index sorting.
  111. # modindex_common_prefix = []
  112. # If true, keep warnings as "system message" paragraphs in the built documents.
  113. # keep_warnings = False
  114. # -- Options for HTML output -------------------------------------------------
  115. # The theme to use for HTML and HTML Help pages. See the documentation for
  116. # a list of builtin themes.
  117. html_theme = "alabaster"
  118. # Theme options are theme-specific and customize the look and feel of a theme
  119. # further. For a list of options available for each theme, see the
  120. # documentation.
  121. html_theme_options = {
  122. "sidebar_width": "300px",
  123. "page_width": "1200px"
  124. }
  125. # Add any paths that contain custom themes here, relative to this directory.
  126. # html_theme_path = []
  127. # The name for this set of Sphinx documents. If None, it defaults to
  128. # "<project> v<release> documentation".
  129. try:
  130. from rfidacd import __version__ as version
  131. except ImportError:
  132. pass
  133. else:
  134. release = version
  135. # A shorter title for the navigation bar. Default is the same as html_title.
  136. # html_short_title = None
  137. # The name of an image file (relative to this directory) to place at the top
  138. # of the sidebar.
  139. # html_logo = ""
  140. # The name of an image file (within the static path) to use as favicon of the
  141. # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
  142. # pixels large.
  143. # html_favicon = None
  144. # Add any paths that contain custom static files (such as style sheets) here,
  145. # relative to this directory. They are copied after the builtin static files,
  146. # so a file named "default.css" will overwrite the builtin "default.css".
  147. html_static_path = ["_static"]
  148. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  149. # using the given strftime format.
  150. # html_last_updated_fmt = '%b %d, %Y'
  151. # If true, SmartyPants will be used to convert quotes and dashes to
  152. # typographically correct entities.
  153. # html_use_smartypants = True
  154. # Custom sidebar templates, maps document names to template names.
  155. # html_sidebars = {}
  156. # Additional templates that should be rendered to pages, maps page names to
  157. # template names.
  158. # html_additional_pages = {}
  159. # If false, no module index is generated.
  160. # html_domain_indices = True
  161. # If false, no index is generated.
  162. # html_use_index = True
  163. # If true, the index is split into individual pages for each letter.
  164. # html_split_index = False
  165. # If true, links to the reST sources are added to the pages.
  166. # html_show_sourcelink = True
  167. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  168. # html_show_sphinx = True
  169. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  170. # html_show_copyright = True
  171. # If true, an OpenSearch description file will be output, and all pages will
  172. # contain a <link> tag referring to it. The value of this option must be the
  173. # base URL from which the finished HTML is served.
  174. # html_use_opensearch = ''
  175. # This is the file name suffix for HTML files (e.g. ".xhtml").
  176. # html_file_suffix = None
  177. # Output file base name for HTML help builder.
  178. htmlhelp_basename = "rfidacd-doc"
  179. # -- Options for LaTeX output ------------------------------------------------
  180. latex_elements = {
  181. # The paper size ("letterpaper" or "a4paper").
  182. # "papersize": "letterpaper",
  183. # The font size ("10pt", "11pt" or "12pt").
  184. # "pointsize": "10pt",
  185. # Additional stuff for the LaTeX preamble.
  186. # "preamble": "",
  187. }
  188. # Grouping the document tree into LaTeX files. List of tuples
  189. # (source start file, target name, title, author, documentclass [howto/manual]).
  190. latex_documents = [
  191. ("index", "user_guide.tex", "rfidacd Documentation", "Thomas Verchow", "manual")
  192. ]
  193. # The name of an image file (relative to this directory) to place at the top of
  194. # the title page.
  195. # latex_logo = ""
  196. # For "manual" documents, if this is true, then toplevel headings are parts,
  197. # not chapters.
  198. # latex_use_parts = False
  199. # If true, show page references after internal links.
  200. # latex_show_pagerefs = False
  201. # If true, show URL addresses after external links.
  202. # latex_show_urls = False
  203. # Documents to append as an appendix to all manuals.
  204. # latex_appendices = []
  205. # If false, no module index is generated.
  206. # latex_domain_indices = True
  207. # -- External mapping --------------------------------------------------------
  208. python_version = ".".join(map(str, sys.version_info[0:2]))
  209. intersphinx_mapping = {
  210. "sphinx": ("http://www.sphinx-doc.org/en/stable", None),
  211. "python": ("https://docs.python.org/" + python_version, None),
  212. "matplotlib": ("https://matplotlib.org", None),
  213. "numpy": ("https://docs.scipy.org/doc/numpy", None),
  214. "sklearn": ("https://scikit-learn.org/stable", None),
  215. "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
  216. "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
  217. "pyscaffold": ("https://pyscaffold.org/en/stable", None),
  218. }