/ docs / conf.py
conf.py
  1  # -*- coding: utf-8 -*-
  2  
  3  import os
  4  import sys
  5  sys.path.insert(0, os.path.abspath('..'))
  6  
  7  # -- General configuration ------------------------------------------------
  8  
  9  # Add any Sphinx extension module names here, as strings. They can be
 10  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 11  # ones.
 12  extensions = [
 13      'sphinx.ext.autodoc',
 14      'sphinx.ext.intersphinx',
 15      'sphinx.ext.viewcode',
 16  ]
 17  
 18  intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
 19                         'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
 20  
 21  # Show the docstring from both the class and its __init__() method
 22  autoclass_content = 'both'
 23  autodoc_member_order = 'bysource'
 24  autodoc_mock_imports = ['board', 'digitalio', 'pulseio']
 25  
 26  # Add any paths that contain templates here, relative to this directory.
 27  templates_path = ['_templates']
 28  
 29  source_suffix = '.rst'
 30  
 31  # The master toctree document.
 32  master_doc = 'index'
 33  
 34  # General information about the project.
 35  project = u'Adafruit HCSR04 Library'
 36  copyright = u'2017 Mike Mabey'
 37  author = u'Mike Mabey'
 38  
 39  # The version info for the project you're documenting, acts as replacement for
 40  # |version| and |release|, also used in various other places throughout the
 41  # built documents.
 42  #
 43  # The full version, including alpha/beta/rc tags.
 44  release = open('../VERSION').read().strip()
 45  # The short X.Y version.
 46  version = '.'.join(release.split('.')[:2])
 47  
 48  # The language for content autogenerated by Sphinx. Refer to documentation
 49  # for a list of supported languages.
 50  #
 51  # This is also used if you do content translation via gettext catalogs.
 52  # Usually you set "language" from the command line for these cases.
 53  language = None
 54  
 55  # List of patterns, relative to source directory, that match files and
 56  # directories to ignore when looking for source files.
 57  # This patterns also effect to html_static_path and html_extra_path
 58  exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
 59  
 60  # The reST default role (used for this markup: `text`) to use for all
 61  # documents.
 62  #
 63  default_role = "any"
 64  
 65  # If true, '()' will be appended to :func: etc. cross-reference text.
 66  #
 67  add_function_parentheses = True
 68  
 69  # The name of the Pygments (syntax highlighting) style to use.
 70  pygments_style = 'sphinx'
 71  
 72  # If true, `todo` and `todoList` produce output, else they produce nothing.
 73  todo_include_todos = False
 74  
 75  
 76  # -- Options for HTML output ----------------------------------------------
 77  
 78  # The theme to use for HTML and HTML Help pages.  See the documentation for
 79  # a list of builtin themes.
 80  #
 81  on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
 82  
 83  if not on_rtd:  # only import and set the theme if we're building docs locally
 84      try:
 85          import sphinx_rtd_theme
 86          html_theme = 'sphinx_rtd_theme'
 87          html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
 88      except:
 89          html_theme = 'default'
 90          html_theme_path = ['.']
 91  else:
 92      html_theme_path = ['.']
 93  
 94  # Add any paths that contain custom static files (such as style sheets) here,
 95  # relative to this directory. They are copied after the builtin static files,
 96  # so a file named "default.css" will overwrite the builtin "default.css".
 97  html_static_path = ['_static']
 98  
 99  # Output file base name for HTML help builder.
100  htmlhelp_basename = 'AdafruitHCSR04Librarydoc'
101  
102  # -- Options for LaTeX output ---------------------------------------------
103  
104  latex_elements = {
105       # The paper size ('letterpaper' or 'a4paper').
106       #
107       # 'papersize': 'letterpaper',
108  
109       # The font size ('10pt', '11pt' or '12pt').
110       #
111       # 'pointsize': '10pt',
112  
113       # Additional stuff for the LaTeX preamble.
114       #
115       # 'preamble': '',
116  
117       # Latex figure (float) alignment
118       #
119       # 'figure_align': 'htbp',
120  }
121  
122  # Grouping the document tree into LaTeX files. List of tuples
123  # (source start file, target name, title,
124  #  author, documentclass [howto, manual, or own class]).
125  latex_documents = [
126      (master_doc, 'AdafruitHCSR04Library.tex', u'Adafruit HCSR04 Library Documentation',
127       author, 'manual'),
128  ]
129  
130  # -- Options for manual page output ---------------------------------------
131  
132  # One entry per manual page. List of tuples
133  # (source start file, name, description, authors, manual section).
134  man_pages = [
135      (master_doc, 'adafruitHCSR04library', u'Adafruit HCSR04 Library Documentation',
136       [author], 1)
137  ]
138  
139  # -- Options for Texinfo output -------------------------------------------
140  
141  # Grouping the document tree into Texinfo files. List of tuples
142  # (source start file, target name, title, author,
143  #  dir menu entry, description, category)
144  texinfo_documents = [
145      (master_doc, 'AdafruitHCSR04Library', u'Adafruit HCSR04 Library Documentation',
146       author, 'AdafruitHCSR04Library', 'One line description of project.',
147       'Miscellaneous'),
148  ]