1# -*- coding: utf-8 -*- 2# Flang documentation build configuration file. 3# 4# This file is execfile()d with the current directory set to its containing dir. 5# 6# Note that not all possible configuration values are present in this 7# autogenerated file. 8# 9# All configuration values have a default; values that are commented out 10# serve to show the default. 11 12import sys, os 13from datetime import date 14from recommonmark.parser import CommonMarkParser 15 16# If extensions (or modules to document with autodoc) are in another directory, 17# add these directories to sys.path here. If the directory is relative to the 18# documentation root, use os.path.abspath to make it absolute, like shown here. 19#sys.path.insert(0, os.path.abspath('.')) 20 21# -- General configuration ----------------------------------------------------- 22 23# https://github.com/readthedocs/recommonmark/issues/177 24#Method used to remove the warning message. 25class CustomCommonMarkParser(CommonMarkParser): 26 def visit_document(self, node): 27 pass 28 29 30# If your documentation needs a minimal Sphinx version, state it here. 31#needs_sphinx = '1.0' 32# Add any Sphinx extension module names here, as strings. They can be extensions 33# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 34extensions = ['sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx'] 35 36# Add any paths that contain templates here, relative to this directory. 37templates_path = ['_templates'] 38 39# The suffix of source filenames. 40source_suffix = { 41 '.rst': 'restructuredtext', 42} 43try: 44 import recommonmark 45except ImportError: 46 # manpages do not use any .md sources 47 if not tags.has('builder-man'): 48 raise 49else: 50 import sphinx 51 if sphinx.version_info >= (3, 0): 52 # This requires 0.5 or later. 53 extensions.append('recommonmark') 54 else: 55 source_parsers = {'.md': CustomCommonMarkParser} 56 source_suffix['.md'] = 'markdown' 57 extensions.append('sphinx_markdown_tables') 58 59 # Setup AutoStructify for inline .rst toctrees in index.md 60 from recommonmark.transform import AutoStructify 61 62 # Stolen from https://github.com/readthedocs/recommonmark/issues/93 63 # Monkey patch to fix recommonmark 0.4 doc reference issues. 64 from recommonmark.states import DummyStateMachine 65 orig_run_role = DummyStateMachine.run_role 66 def run_role(self, name, options=None, content=None): 67 if name == 'doc': 68 name = 'any' 69 return orig_run_role(self, name, options, content) 70 DummyStateMachine.run_role = run_role 71 72 def setup(app): 73 # Disable inline math to avoid 74 # https://github.com/readthedocs/recommonmark/issues/120 in Extensions.md 75 app.add_config_value('recommonmark_config', { 76 'enable_inline_math': False 77 }, True) 78 app.add_transform(AutoStructify) 79 80# The encoding of source files. 81#source_encoding = 'utf-8-sig' 82 83# The master toctree document. 84master_doc = 'index' 85 86# General information about the project. 87project = u'Flang' 88copyright = u'2017-%d, The Flang Team' % date.today().year 89 90# The version info for the project you're documenting, acts as replacement for 91# |version| and |release|, also used in various other places throughout the 92# built documents. These are currently set to zero because we don't use them. 93# Should somebody consider in the future to change them, they need to be updated 94# everytime a new release comes out. 95# 96# The short version. 97#version = '0' 98# The full version, including alpha/beta/rc tags. 99#release = '0' 100 101# The language for content autogenerated by Sphinx. Refer to documentation 102# for a list of supported languages. 103#language = None 104 105# There are two options for replacing |today|: either, you set today to some 106# non-false value, then it is used: 107#today = '' 108# Else, today_fmt is used as the format for a strftime call. 109#today_fmt = '%B %d, %Y' 110 111# List of patterns, relative to source directory, that match files and 112# directories to ignore when looking for source files. 113exclude_patterns = ['_build', 'analyzer'] 114 115# The reST default role (used for this markup: `text`) to use for all documents. 116#default_role = None 117 118# If true, '()' will be appended to :func: etc. cross-reference text. 119#add_function_parentheses = True 120 121# If true, the current module name will be prepended to all description 122# unit titles (such as .. function::). 123#add_module_names = True 124 125# If true, sectionauthor and moduleauthor directives will be shown in the 126# output. They are ignored by default. 127#show_authors = False 128 129# The name of the Pygments (syntax highlighting) style to use. 130pygments_style = 'friendly' 131 132# A list of ignored prefixes for module index sorting. 133#modindex_common_prefix = [] 134 135 136# -- Options for HTML output --------------------------------------------------- 137 138# The theme to use for HTML and HTML Help pages. See the documentation for 139# a list of builtin themes. 140html_theme = 'llvm-theme' 141 142# Theme options are theme-specific and customize the look and feel of a theme 143# further. For a list of options available for each theme, see the 144# documentation. 145html_theme_options = { "nosidebar": False } 146 147# Add any paths that contain custom themes here, relative to this directory. 148html_theme_path = ["_themes"] 149 150# Add any paths that contain custom themes here, relative to this directory. 151#html_theme_path = [] 152 153# The name for this set of Sphinx documents. If None, it defaults to 154# "<project> v<release> documentation". 155html_title = 'The Flang Compiler' 156 157# A shorter title for the navigation bar. Default is the same as html_title. 158#html_short_title = None 159 160# The name of an image file (relative to this directory) to place at the top 161# of the sidebar. 162#html_logo = None 163 164# The name of an image file (within the static path) to use as favicon of the 165# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 166# pixels large. 167#html_favicon = None 168 169# Add any paths that contain custom static files (such as style sheets) here, 170# relative to this directory. They are copied after the builtin static files, 171# so a file named "default.css" will overwrite the builtin "default.css". 172html_static_path = ['_static'] 173 174html_context = { 175 'css_files': [ 176 '_static/llvm.css' 177 ], 178 } 179 180# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 181# using the given strftime format. 182html_last_updated_fmt = '%b %d, %Y' 183 184# If true, SmartyPants will be used to convert quotes and dashes to 185# typographically correct entities. 186#html_use_smartypants = True 187 188# Custom sidebar templates, maps document names to template names. 189html_sidebars = { 190 '**': [ 191 'indexsidebar.html', 192 'searchbox.html', 193 ] 194} 195 196 197# Additional templates that should be rendered to pages, maps page names to 198# template names. 199#html_additional_pages = {} 200 201# If false, no module index is generated. 202#html_domain_indices = True 203 204# If false, no index is generated. 205#html_use_index = True 206 207# If true, the index is split into individual pages for each letter. 208#html_split_index = False 209 210# If true, links to the reST sources are added to the pages. 211#html_show_sourcelink = True 212 213# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 214#html_show_sphinx = True 215 216# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 217#html_show_copyright = True 218 219# If true, an OpenSearch description file will be output, and all pages will 220# contain a <link> tag referring to it. The value of this option must be the 221# base URL from which the finished HTML is served. 222#html_use_opensearch = '' 223 224# This is the file name suffix for HTML files (e.g. ".xhtml"). 225#html_file_suffix = None 226 227# Output file base name for HTML help builder. 228htmlhelp_basename = 'Flangdoc' 229 230# If true, the reST sources are included in the HTML build as 231# _sources/name. The default is True. 232html_copy_source = False 233 234# -- Options for LaTeX output -------------------------------------------------- 235 236latex_elements = { 237# The paper size ('letterpaper' or 'a4paper'). 238#'papersize': 'letterpaper', 239 240# The font size ('10pt', '11pt' or '12pt'). 241#'pointsize': '10pt', 242 243# Additional stuff for the LaTeX preamble. 244#'preamble': '', 245} 246 247# Grouping the document tree into LaTeX files. List of tuples 248# (source start file, target name, title, author, documentclass [howto/manual]). 249latex_documents = [ 250 ('Overview', 'Flang.tex', u'Flang Documentation', 251 u'The Flang Team', 'manual'), 252] 253 254# The name of an image file (relative to this directory) to place at the top of 255# the title page. 256#latex_logo = None 257 258# For "manual" documents, if this is true, then toplevel headings are parts, 259# not chapters. 260#latex_use_parts = False 261 262# If true, show page references after internal links. 263#latex_show_pagerefs = False 264 265# If true, show URL addresses after external links. 266#latex_show_urls = False 267 268# Documents to append as an appendix to all manuals. 269#latex_appendices = [] 270 271# If false, no module index is generated. 272#latex_domain_indices = True 273 274 275# -- Options for manual page output -------------------------------------------- 276 277# One entry per manual page. List of tuples 278# (source start file, name, description, authors, manual section). 279man_pages = [] 280 281# If true, show URL addresses after external links. 282#man_show_urls = False 283 284 285# -- Options for Texinfo output ------------------------------------------------ 286 287# Grouping the document tree into Texinfo files. List of tuples 288# (source start file, target name, title, author, 289# dir menu entry, description, category) 290texinfo_documents = [ 291 ('Overview', 'Flang', u'Flang Documentation', 292 u'The Flang Team', 'Flang', 'A Fortran front end for LLVM.', 293 'Miscellaneous'), 294] 295 296# Documents to append as an appendix to all manuals. 297#texinfo_appendices = [] 298 299# If false, no module index is generated. 300#texinfo_domain_indices = True 301 302# How to display URL addresses: 'footnote', 'no', or 'inline'. 303#texinfo_show_urls = 'footnote' 304