tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

conf.py (6998B)


      1 # -*- coding: utf-8 -*-
      2 #
      3 # Configuration file for the Sphinx documentation builder.
      4 #
      5 # This file does only contain a selection of the most common options. For a
      6 # full list see the documentation:
      7 # http://www.sphinx-doc.org/en/master/config
      8 
      9 # -- Path setup --------------------------------------------------------------
     10 
     11 # If extensions (or modules to document with autodoc) are in another directory,
     12 # add these directories to sys.path here. If the directory is relative to the
     13 # documentation root, use os.path.abspath to make it absolute, like shown here.
     14 #
     15 import os
     16 import sys
     17 sys.path.insert(0, os.path.abspath('..'))
     18 sys.path.insert(0, os.path.abspath('../tools/wptserve'))
     19 sys.path.insert(0, os.path.abspath('../tools/third_party/pywebsocket3'))
     20 sys.path.insert(0, os.path.abspath('../tools'))
     21 import localpaths
     22 
     23 # -- Project information -----------------------------------------------------
     24 
     25 project = u'web-platform-tests'
     26 copyright = u'2019, wpt contributors'
     27 author = u'wpt contributors'
     28 
     29 # The short X.Y version
     30 version = u''
     31 # The full version, including alpha/beta/rc tags
     32 release = u''
     33 
     34 
     35 # -- General configuration ---------------------------------------------------
     36 
     37 # If your documentation needs a minimal Sphinx version, state it here.
     38 #
     39 # needs_sphinx = '1.0'
     40 
     41 # Add any Sphinx extension module names here, as strings. They can be
     42 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
     43 # ones.
     44 extensions = [
     45    'recommonmark',
     46    'sphinxarg.ext',
     47    'sphinx.ext.autodoc',
     48    'sphinx.ext.intersphinx',
     49    # Google-style Python docs
     50    'sphinx.ext.napoleon',
     51    'sphinx_js'
     52 ]
     53 
     54 # Add any paths that contain templates here, relative to this directory.
     55 templates_path = ['_templates']
     56 
     57 # The suffix(es) of source filenames.
     58 # You can specify multiple suffix as a list of string:
     59 #
     60 # source_suffix = ['.rst', '.md']
     61 source_suffix = '.rst'
     62 
     63 # The master toctree document.
     64 master_doc = 'index'
     65 
     66 # These values are used in third-party documentation not recognized by Sphinx.
     67 # https://stackoverflow.com/questions/51824453/how-to-document-parameter-of-type-function-in-sphinx
     68 nitpick_ignore = [
     69    # wptserve
     70    ('py:class', 'Callable'),
     71    ('py:obj', 'None'),
     72    # pywebsocket3
     73    ('py:exc', 'AbortedByUserException'),
     74    ('py:exc', 'HandshakeException'),
     75    ('py:exc', 'InvalidFrameException'),
     76    ('py:exc', 'UnsupportedFrameException'),
     77    ('py:exc', 'InvalidUTF8Exception'),
     78    ('py:exc', 'ConnectionTerminatedException'),
     79    ('py:exc', 'BadOperationException'),
     80    ('py:exc', 'Exception'),
     81    ('py:exc', 'ValueError'),
     82    ('py:class', 'http.client.HTTPMessage')
     83 ]
     84 
     85 # The language for content autogenerated by Sphinx. Refer to documentation
     86 # for a list of supported languages.
     87 #
     88 # This is also used if you do content translation via gettext catalogs.
     89 # Usually you set "language" from the command line for these cases.
     90 language = None
     91 
     92 # List of patterns, relative to source directory, that match files and
     93 # directories to ignore when looking for source files.
     94 # This pattern also affects html_static_path and html_extra_path.
     95 exclude_patterns = [
     96    '**/.tox',
     97    '**/.DS_Store',
     98    '**/Thumbs.db',
     99    '_build',
    100    'node_modules',
    101    'package.json',
    102    'package-lock.json',
    103 ]
    104 
    105 from docs.wpt_lint_rules import WPTLintRules
    106 # Enable inline reStructured Text within Markdown-formatted files
    107 # https://recommonmark.readthedocs.io/en/latest/auto_structify.html
    108 from recommonmark.transform import AutoStructify
    109 def setup(app):
    110    app.add_transform(AutoStructify)
    111    app.add_directive('wpt-lint-rules', WPTLintRules)
    112 
    113 # The name of the Pygments (syntax highlighting) style to use.
    114 pygments_style = None
    115 
    116 
    117 # -- Options for HTML output -------------------------------------------------
    118 
    119 # The theme to use for HTML and HTML Help pages.  See the documentation for
    120 # a list of builtin themes.
    121 #
    122 html_theme = 'alabaster'
    123 
    124 # Theme options are theme-specific and customize the look and feel of a theme
    125 # further.  For a list of options available for each theme, see the
    126 # documentation.
    127 #
    128 # html_theme_options = {}
    129 
    130 # Add any paths that contain custom static files (such as style sheets) here,
    131 # relative to this directory. They are copied after the builtin static files,
    132 # so a file named "default.css" will overwrite the builtin "default.css".
    133 html_static_path = ['assets']
    134 
    135 # Custom sidebar templates, must be a dictionary that maps document names
    136 # to template names.
    137 #
    138 # The default sidebars (for documents that don't match any pattern) are
    139 # defined by theme itself.  Builtin themes are using these templates by
    140 # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
    141 # 'searchbox.html']``.
    142 #
    143 # html_sidebars = {}
    144 
    145 # Sphix-js configuration
    146 
    147 # Only document things under resources/ for now
    148 js_source_path = '../resources'
    149 
    150 # -- Options for HTMLHelp output ---------------------------------------------
    151 
    152 # Output file base name for HTML help builder.
    153 htmlhelp_basename = 'web-platform-testsdoc'
    154 
    155 
    156 # -- Options for LaTeX output ------------------------------------------------
    157 
    158 latex_elements = {
    159    # The paper size ('letterpaper' or 'a4paper').
    160    #
    161    # 'papersize': 'letterpaper',
    162 
    163    # The font size ('10pt', '11pt' or '12pt').
    164    #
    165    # 'pointsize': '10pt',
    166 
    167    # Additional stuff for the LaTeX preamble.
    168    #
    169    # 'preamble': '',
    170 
    171    # Latex figure (float) alignment
    172    #
    173    # 'figure_align': 'htbp',
    174 }
    175 
    176 # Grouping the document tree into LaTeX files. List of tuples
    177 # (source start file, target name, title,
    178 #  author, documentclass [howto, manual, or own class]).
    179 latex_documents = [
    180    (master_doc, 'web-platform-tests.tex', u'web-platform-tests Documentation',
    181     u'wpt contributors', 'manual'),
    182 ]
    183 
    184 
    185 # -- Options for manual page output ------------------------------------------
    186 
    187 # One entry per manual page. List of tuples
    188 # (source start file, name, description, authors, manual section).
    189 man_pages = [
    190    (master_doc, 'web-platform-tests', u'web-platform-tests Documentation',
    191     [author], 1)
    192 ]
    193 
    194 
    195 # -- Options for Texinfo output ----------------------------------------------
    196 
    197 # Grouping the document tree into Texinfo files. List of tuples
    198 # (source start file, target name, title, author,
    199 #  dir menu entry, description, category)
    200 texinfo_documents = [
    201    (master_doc, 'web-platform-tests', u'web-platform-tests Documentation',
    202     author, 'web-platform-tests', 'One line description of project.',
    203     'Miscellaneous'),
    204 ]
    205 
    206 
    207 # -- Options for Epub output -------------------------------------------------
    208 
    209 # Bibliographic Dublin Core info.
    210 epub_title = project
    211 
    212 # The unique identifier of the text. This can be a ISBN number
    213 # or the project homepage.
    214 #
    215 # epub_identifier = ''
    216 
    217 # A unique identification for the text.
    218 #
    219 # epub_uid = ''
    220 
    221 # A list of files that should not be packed into the epub file.
    222 epub_exclude_files = ['search.html']
    223 
    224 intersphinx_mapping = {'python': ('https://docs.python.org/3/', None),
    225                       'mozilla': ('https://firefox-source-docs.mozilla.org/', None)}