github.com/imran-kn/cilium-fork@v1.6.9/Documentation/conf.py (about) 1 # -*- coding: utf-8 -*- 2 # 3 # Cilium documentation build configuration file, created by 4 # sphinx-quickstart on Sun Feb 12 18:34:43 2017. 5 # 6 # This file is execfile()d with the current directory set to its 7 # containing dir. 8 # 9 # Note that not all possible configuration values are present in this 10 # autogenerated file. 11 # 12 # All configuration values have a default; values that are commented out 13 # serve to show the default. 14 15 # If extensions (or modules to document with autodoc) are in another directory, 16 # add these directories to sys.path here. If the directory is relative to the 17 # documentation root, use os.path.abspath to make it absolute, like shown here. 18 # 19 import os 20 # import sys 21 import re 22 import subprocess 23 # sys.path.insert(0, os.path.abspath('.')) 24 25 26 # -- General configuration ------------------------------------------------ 27 28 # If your documentation needs a minimal Sphinx version, state it here. 29 # 30 # needs_sphinx = '1.0' 31 32 # Add any Sphinx extension module names here, as strings. They can be 33 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 34 # ones. 35 extensions = ['sphinx.ext.ifconfig', 36 'sphinx.ext.githubpages', 37 'sphinx.ext.extlinks', 38 'sphinxcontrib.openapi', 39 'sphinx_tabs.tabs', 40 'sphinxcontrib.spelling', 41 'versionwarning.extension' ] 42 43 # Add any paths that contain templates here, relative to this directory. 44 templates_path = ['_templates'] 45 46 # The suffix(es) of source filenames. 47 # You can specify multiple suffix as a list of string: 48 # 49 # source_suffix = ['.rst', '.md'] 50 source_suffix = ['.rst', '.md'] 51 source_parsers = { 52 '.md': 'recommonmark.parser.CommonMarkParser', 53 } 54 55 # The master toctree document. 56 master_doc = 'index' 57 58 # General information about the project. 59 project = u'Cilium' 60 copyright = u'2017-2019, Cilium Authors' 61 author = u'Cilium Authors' 62 63 # The version info for the project you're documenting, acts as replacement for 64 # |version| and |release|, also used in various other places throughout the 65 # built documents. 66 # 67 # The short X.Y version. 68 release = open("../VERSION", "r").read().strip() 69 # Used by version warning 70 versionwarning_body_selector = "div.document" 71 72 # Fetch the docs version from an environment variable. 73 # Map latest -> master. 74 # Map stable -> current version number. 75 branch = os.environ.get('READTHEDOCS_VERSION') 76 if branch == None or branch == 'latest': 77 branch = 'HEAD' 78 archive_name = 'master' 79 elif branch == 'stable': 80 branch = release 81 archive_name = release 82 else: 83 archive_name = branch 84 githubusercontent = 'https://raw.githubusercontent.com/cilium/cilium/' 85 scm_web = githubusercontent + branch 86 jenkins_branch = 'https://jenkins.cilium.io/view/Cilium-v' + release[0:3] 87 archive_filename = archive_name +'.tar.gz' 88 archive_link = 'https://github.com/cilium/cilium/archive/' + archive_filename 89 archive_name = 'cilium-' + archive_name.strip('v') 90 91 # Store variables in the epilogue so they are globally available. 92 rst_epilog = """ 93 .. |SCM_WEB| replace:: \{s} 94 .. |SCM_BRANCH| replace:: \{b} 95 .. |SCM_ARCHIVE_NAME| replace:: \{a} 96 .. |SCM_ARCHIVE_FILENAME| replace:: \{f} 97 .. |SCM_ARCHIVE_LINK| replace:: \{l} 98 """.format(s = scm_web, b = branch, a = archive_name, f = archive_filename, l = archive_link) 99 100 extlinks = { 101 'git-tree': (scm_web + "/%s", ''), 102 'jenkins-branch': (jenkins_branch + "/%s", ''), 103 } 104 105 # The language for content autogenerated by Sphinx. Refer to documentation 106 # for a list of supported languages. 107 # 108 # This is also used if you do content translation via gettext catalogs. 109 # Usually you set "language" from the command line for these cases. 110 language = None 111 112 # List of patterns, relative to source directory, that match files and 113 # directories to ignore when looking for source files. 114 # This patterns also effect to html_static_path and html_extra_path 115 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '_themes/**/*.rst'] 116 117 # The name of the Pygments (syntax highlighting) style to use. 118 pygments_style = 'sphinx' 119 120 # If true, `todo` and `todoList` produce output, else they produce nothing. 121 todo_include_todos = False 122 123 124 # -- Options for HTML output ---------------------------------------------- 125 126 # The theme to use for HTML and HTML Help pages. See the documentation for 127 # a list of builtin themes. 128 # 129 html_theme = "sphinx_rtd_theme" 130 html_theme_path = ["_themes/sphinx_rtd_theme", ] 131 html_style = "static/css/theme.css" 132 html_context = { 133 'release': release 134 } 135 136 # Theme options are theme-specific and customize the look and feel of a theme 137 # further. For a list of options available for each theme, see the 138 # documentation. 139 # 140 # html_theme_options = {} 141 142 # Add any paths that contain custom static files (such as style sheets) here, 143 # relative to this directory. They are copied after the builtin static files, 144 # so a file named "default.css" will overwrite the builtin "default.css". 145 html_static_path = ['images', '_static', '_themes/sphinx_rtd_theme/sphinx_rtd_theme'] 146 147 # -- Options for HTMLHelp output ------------------------------------------ 148 149 # Output file base name for HTML help builder. 150 htmlhelp_basename = 'Ciliumdoc' 151 152 153 # -- Options for LaTeX output --------------------------------------------- 154 155 latex_elements = { 156 # The paper size ('letterpaper' or 'a4paper'). 157 # 158 # 'papersize': 'letterpaper', 159 160 # The font size ('10pt', '11pt' or '12pt'). 161 # 162 # 'pointsize': '10pt', 163 164 # Additional stuff for the LaTeX preamble. 165 # 166 # 'preamble': '', 167 168 # Latex figure (float) alignment 169 # 170 # 'figure_align': 'htbp', 171 'extraclassoptions': 'openany', 172 } 173 174 # Grouping the document tree into LaTeX files. List of tuples 175 # (source start file, target name, title, 176 # author, documentclass [howto, manual, or own class]). 177 latex_documents = [ 178 (master_doc, 'Cilium.tex', u'Cilium Documentation', 179 u'Cilium Authors', 'manual'), 180 ] 181 182 183 # -- Options for manual page output --------------------------------------- 184 185 # One entry per manual page. List of tuples 186 # (source start file, name, description, authors, manual section). 187 man_pages = [ 188 (master_doc, 'cilium', u'Cilium Documentation', 189 [author], 1) 190 ] 191 192 193 # -- Options for Texinfo output ------------------------------------------- 194 195 # Grouping the document tree into Texinfo files. List of tuples 196 # (source start file, target name, title, author, 197 # dir menu entry, description, category) 198 texinfo_documents = [ 199 (master_doc, 'Cilium', u'Cilium Documentation', 200 author, 'Cilium', 'One line description of project.', 201 'Miscellaneous'), 202 ] 203 204 http_strict_mode = False 205 206 # Try as hard as possible to find references 207 default_role = 'any' 208 209 def setup(app): 210 app.add_stylesheet('parsed-literal.css') 211 app.add_stylesheet('copybutton.css') 212 app.add_javascript('clipboardjs.min.js') 213 app.add_javascript("copybutton.js")