|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +# |
| 4 | +# sqlwhat documentation build configuration file, created by |
| 5 | +# sphinx-quickstart on Thu Feb 23 11:22:59 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 | +# Mock heavy duty pythonwhat dependencies for autodoc |
| 17 | +import os |
| 18 | +import sys |
| 19 | +from unittest import mock |
| 20 | +from functools import wraps |
| 21 | + |
| 22 | +def state_dec(f): |
| 23 | + @wraps(f) |
| 24 | + def wrapper(*args, **kwargs): |
| 25 | + return f(*args, **kwargs) |
| 26 | + return wrapper |
| 27 | + |
| 28 | +MOCK_MODULES = ['sqlwhat.grammar.plsql.ast', 'sqlwhat', 'sqlwhat.sct_syntax'] |
| 29 | +for mod_name in MOCK_MODULES: |
| 30 | + sys.modules[mod_name] = mock.Mock(state_dec = state_dec) |
| 31 | + |
| 32 | +# If extensions (or modules to document with autodoc) are in another directory, |
| 33 | +# add these directories to sys.path here. If the directory is relative to the |
| 34 | +# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 35 | +# |
| 36 | +sys.path.insert(0, os.path.abspath('..')) |
| 37 | + |
| 38 | + |
| 39 | +# -- General configuration ------------------------------------------------ |
| 40 | + |
| 41 | +# If your documentation needs a minimal Sphinx version, state it here. |
| 42 | +# |
| 43 | +# needs_sphinx = '1.0' |
| 44 | + |
| 45 | +# Add any Sphinx extension module names here, as strings. They can be |
| 46 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 47 | +# ones. |
| 48 | +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'] |
| 49 | + |
| 50 | +# Add any paths that contain templates here, relative to this directory. |
| 51 | +templates_path = ['_templates'] |
| 52 | + |
| 53 | +# The suffix(es) of source filenames. |
| 54 | +# You can specify multiple suffix as a list of string: |
| 55 | +# |
| 56 | +# source_suffix = ['.rst', '.md'] |
| 57 | +source_suffix = '.rst' |
| 58 | + |
| 59 | +# The master toctree document. |
| 60 | +master_doc = 'index' |
| 61 | + |
| 62 | +# General information about the project. |
| 63 | +project = 'sqlwhat-ext' |
| 64 | +copyright = '2017, DataCamp' |
| 65 | +author = 'DataCamp' |
| 66 | + |
| 67 | +# The version info for the project you're documenting, acts as replacement for |
| 68 | +# |version| and |release|, also used in various other places throughout the |
| 69 | +# built documents. |
| 70 | +# |
| 71 | +# The short X.Y version. |
| 72 | +version = '0.0.7' |
| 73 | +# The full version, including alpha/beta/rc tags. |
| 74 | +release = '0.0.7' |
| 75 | + |
| 76 | +# The language for content autogenerated by Sphinx. Refer to documentation |
| 77 | +# for a list of supported languages. |
| 78 | +# |
| 79 | +# This is also used if you do content translation via gettext catalogs. |
| 80 | +# Usually you set "language" from the command line for these cases. |
| 81 | +language = None |
| 82 | + |
| 83 | +# List of patterns, relative to source directory, that match files and |
| 84 | +# directories to ignore when looking for source files. |
| 85 | +# This patterns also effect to html_static_path and html_extra_path |
| 86 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 87 | + |
| 88 | +# The name of the Pygments (syntax highlighting) style to use. |
| 89 | +pygments_style = 'sphinx' |
| 90 | + |
| 91 | +# If true, `todo` and `todoList` produce output, else they produce nothing. |
| 92 | +todo_include_todos = False |
| 93 | + |
| 94 | + |
| 95 | +# -- Options for HTML output ---------------------------------------------- |
| 96 | + |
| 97 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 98 | +# further. For a list of options available for each theme, see the |
| 99 | +# documentation. |
| 100 | +# |
| 101 | +# html_theme_options = {} |
| 102 | + |
| 103 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 104 | +# relative to this directory. They are copied after the builtin static files, |
| 105 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 106 | +html_static_path = ['_static'] |
| 107 | + |
| 108 | + |
| 109 | +# -- Options for HTMLHelp output ------------------------------------------ |
| 110 | + |
| 111 | +# Output file base name for HTML help builder. |
| 112 | +htmlhelp_basename = 'sqlwhatdoc' |
| 113 | + |
| 114 | + |
| 115 | +def setup(app): |
| 116 | + app.add_stylesheet('theme_overrides.css') |
| 117 | + |
| 118 | +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' |
| 119 | +if not on_rtd: # only import and set the theme if we're building docs locally |
| 120 | + import sphinx_rtd_theme |
| 121 | + html_theme = 'sphinx_rtd_theme' |
| 122 | + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
| 123 | + def setup(app): |
| 124 | + app.add_stylesheet('theme_overrides.css') |
0 commit comments