1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3# 4# libCEED documentation build configuration file, created by 5# sphinx-quickstart on Tue Jan 7 18:59:28 2020. 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# 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# 20# import os 21# import sys 22# sys.path.insert(0, os.path.abspath('.')) 23import sphinx_rtd_theme 24import sys 25import breathe 26import os 27import subprocess 28 29# -- General configuration ------------------------------------------------ 30 31# If your documentation needs a minimal Sphinx version, state it here. 32# 33# needs_sphinx = '1.0' 34 35# Add any Sphinx extension module names here, as strings. They can be 36# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 37# ones. 38extensions = [ 39 'breathe', 40 'hoverxref.extension', # still in beta; not rendering well on RTD 41 'recommonmark', 42 'sphinx_markdown_tables', 43 'sphinx_rtd_theme', 44 'sphinx.ext.autodoc', 45 'sphinx.ext.coverage', 46 'sphinx.ext.doctest', 47 'sphinx.ext.ifconfig', 48 'sphinx.ext.intersphinx', 49 'sphinx.ext.githubpages', 50 'sphinx.ext.mathjax', 51 'sphinxcontrib.mermaid', # still in beta; fails with latexpdf builder 52 'sphinx.ext.todo', 53 'sphinx.ext.viewcode', 54 'sphinxcontrib.bibtex', 55 'sphinxcontrib.rsvgconverter', 56 ] 57 58# The following, if true, allows figures, tables and code-blocks to be 59# automatically numbered if they have a caption. 60numfig = True 61 62# Add any paths that contain templates here, relative to this directory. 63templates_path = ['_templates'] 64 65# The suffix(es) of source filenames. 66# You can specify multiple suffix as a list of string: 67# 68# source_suffix = ['.rst', '.md'] 69source_suffix = { 70 '.rst': 'restructuredtext', 71 '.md': 'markdown'} 72 73# The master toctree document. 74master_doc = 'index' 75 76# General information about the project. 77project = 'libCEED' 78copyright = '2020, LLNL, University of Colorado, University of Illinois, University of Tennesee, and the authors' 79with open('../../../AUTHORS') as f: 80 authorlist = f.readlines() 81author = ', '.join(authorlist) 82 83# The version info for the project you're documenting, acts as replacement for 84# |version| and |release|, also used in various other places throughout the 85# built documents. 86# 87# The short X.Y version. 88with open('../../../ceed.pc.template') as f: 89 pkgconf_version = 'unknown' 90 for line in f: 91 if line.startswith('Version:'): 92 pkgconf_version = line.partition(': ')[2] 93 break 94version = pkgconf_version 95# The full version, including alpha/beta/rc tags. 96release = pkgconf_version 97 98# The language for content autogenerated by Sphinx. Refer to documentation 99# for a list of supported languages. 100# 101# This is also used if you do content translation via gettext catalogs. 102# Usually you set "language" from the command line for these cases. 103language = None 104 105# List of patterns, relative to source directory, that match files and 106# directories to ignore when looking for source files. 107# This patterns also effect to html_static_path and html_extra_path 108exclude_patterns = [] 109 110# The name of the Pygments (syntax highlighting) style to use. 111pygments_style = 'sphinx' 112 113# If true, `todo` and `todoList` produce output, else they produce nothing. 114todo_include_todos = True 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# 122html_theme = 'sphinx_rtd_theme' 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". 133html_static_path = ['_static'] 134 135# Custom sidebar templates, must be a dictionary that maps document names 136# to template names. 137# 138# This is required for the alabaster theme 139# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars 140html_sidebars = { 141 '**': [ 142 'relations.html', # needs 'show_related': True theme option to display 143 'searchbox.html', 144 ] 145} 146 147# hoverxref options 148hoverxref_auto_ref = True 149hoverxref_mathjax = True 150 151# -- Options for HTMLHelp output ------------------------------------------ 152 153# Output file base name for HTML help builder. 154htmlhelp_basename = 'libCEEDdoc' 155 156 157# -- Options for LaTeX output --------------------------------------------- 158 159latex_engine = 'xelatex' 160 161latex_elements = { 162 # The paper size ('letterpaper' or 'a4paper'). 163 # 164 # 'papersize': 'letterpaper', 165 166 # The font size ('10pt', '11pt' or '12pt'). 167 # 168 # 'pointsize': '10pt', 169 170 # Additional stuff for the LaTeX preamble. 171 # 172 # 'preamble': '', 173 174 # Latex figure (float) alignment 175 # 176 # 'figure_align': 'htbp', 177 'fontenc': r'\usepackage{mathspec}', 178 'fontpkg': r''' 179\setmainfont{TeX Gyre Pagella} 180\setmathfont{TeX Gyre Pagella Math} 181\setsansfont{DejaVu Sans} 182\setmonofont{DejaVu Sans Mono} 183''', 184} 185 186latex_logo = '../../img/ceed-full-name-logo.PNG' 187 188latexauthorslist = r' \and '.join(authorlist) 189 190# Grouping the document tree into LaTeX files. List of tuples 191# (source start file, target name, title, 192# author, documentclass [howto, manual, or own class]). 193latex_documents = [ 194 (master_doc, 'libCEED.tex', 'libCEED User Manual', 195 latexauthorslist, 'howto'), 196] 197 198 199# -- Options for manual page output --------------------------------------- 200 201# One entry per manual page. List of tuples 202# (source start file, name, description, authors, manual section). 203man_pages = [ 204 (master_doc, 'libceed', 'libCEED User Manual', 205 [author], 1) 206] 207 208 209# -- Options for Texinfo output ------------------------------------------- 210 211# Grouping the document tree into Texinfo files. List of tuples 212# (source start file, target name, title, author, 213# dir menu entry, description, category) 214texinfo_documents = [ 215 (master_doc, 'libCEED', 'libCEED User Manual', 216 latexauthorslist, 'libCEED', 'Efficient implementations of finite element operators.', 217 'Miscellaneous'), 218] 219 220 221# -- Options for Epub output ---------------------------------------------- 222 223# Bibliographic Dublin Core info. 224epub_title = project 225epub_author = author 226epub_publisher = author 227epub_copyright = copyright 228 229# The unique identifier of the text. This can be a ISBN number 230# or the project homepage. 231# 232# epub_identifier = '' 233 234# A unique identification for the text. 235# 236# epub_uid = '' 237 238# A list of files that should not be packed into the epub file. 239epub_exclude_files = ['search.html'] 240 241 242# Example configuration for intersphinx: refer to the Python standard library. 243intersphinx_mapping = {'https://docs.python.org/': None} 244 245 246# -- Options for breathe -------------------------------------------------- 247sys.path.append(breathe.__path__) 248breathe_projects = {"libCEED": "../../../xml"} 249breathe_default_project = "libCEED" 250breathe_build_directory = "../build/breathe" 251#breathe_domain_by_extension = {"c": "c", "h": "c", "cpp": "cpp", "hpp": "cpp"} 252 253# Run Doxygen if building on Read The Docs 254rootdir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir) 255if os.environ.get('READTHEDOCS'): 256 subprocess.check_call(['doxygen', 'Doxyfile'], cwd=rootdir) 257 258# Copy example documentation from source tree 259def mkdir_p(path): 260 try: 261 os.makedirs(path) 262 except FileExistsError: 263 pass 264 265import glob 266import shutil 267try: 268 shutil.rmtree('examples') 269except FileNotFoundError: 270 pass 271for filename in glob.glob(os.path.join(rootdir, 'examples/**/*.rst'), recursive=True): 272 destdir = os.path.dirname(os.path.relpath(filename, rootdir)) 273 mkdir_p(destdir) 274 shutil.copy2(filename, destdir) 275