blob: baac39461caaaa470f5631710e820d6ba78c588f [file] [log] [blame]
Austin Schuh9049e202022-02-20 17:34:16 -08001#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3#
4# OSQP documentation build configuration file, created by
5# sphinx-quickstart on Sat Feb 18 15:49:00 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# 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
20import sphinx_rtd_theme
21import os
22import subprocess
23# import sys
24# sys.path.insert(0, os.path.abspath('.'))
25
26__version__ = os.environ.get('OSQP_VERSION', '0.0.0')
27
28# An incoming version number of '0.0.0' is a placeholder for missing version information.
29# In such cases, use a <blank> version to effectively avoid mentioning the version number
30# in the built documentation at all.
31__version__ = '' if __version__ == '0.0.0' else __version__
32
33# Set OSQP_VERSION envvar in case subprocesses (like doxygen) need it too
34os.environ['OSQP_VERSION'] = __version__
35
36# -- General configuration ------------------------------------------------
37
38# If your documentation needs a minimal Sphinx version, state it here.
39#
40# needs_sphinx = '1.0'
41
42# Add any Sphinx extension module names here, as strings. They can be
43# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
44# ones.
45extensions = ['sphinx.ext.todo', 'sphinx.ext.mathjax', 'breathe']
46
47# Add any paths that contain templates here, relative to this directory.
48templates_path = ['_templates']
49
50# The suffix(es) of source filenames.
51# You can specify multiple suffix as a list of string:
52#
53# source_suffix = ['.rst', '.md']
54source_suffix = '.rst'
55
56# The master toctree document.
57master_doc = 'index'
58
59# General information about the project.
60project = 'OSQP'
61copyright = '2021, Bartolomeo Stellato, Goran Banjac'
62author = 'Bartolomeo Stellato, Goran Banjac'
63
64# The version info for the project you're documenting, acts as replacement for
65# |version| and |release|, also used in various other places throughout the
66# built documents.
67#
68
69version = '.'.join(__version__.split('.')[:4])
70
71# The full version, including alpha/beta/rc tags.
72release = __version__
73
74# The language for content autogenerated by Sphinx. Refer to documentation
75# for a list of supported languages.
76#
77# This is also used if you do content translation via gettext catalogs.
78# Usually you set "language" from the command line for these cases.
79language = None
80
81# List of patterns, relative to source directory, that match files and
82# directories to ignore when looking for source files.
83# This patterns also effect to html_static_path and html_extra_path
84exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
85
86# The name of the Pygments (syntax highlighting) style to use.
87pygments_style = 'sphinx'
88
89# If true, `todo` and `todoList` produce output, else they produce nothing.
90todo_include_todos = False
91
92
93# -- Options for HTML output ----------------------------------------------
94
95# The theme to use for HTML and HTML Help pages. See the documentation for
96# a list of builtin themes.
97#
98html_theme = 'sphinx_rtd_theme'
99html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
100
101# Theme options are theme-specific and customize the look and feel of a theme
102# further. For a list of options available for each theme, see the
103# documentation.
104#
105
106html_theme_options = {
107 'logo_only': True,
108}
109
110
111html_logo = '_static/img/logo.png'
112html_favicon = "_static/img/favicon.ico"
113
114# Add any paths that contain custom static files (such as style sheets) here,
115# relative to this directory. They are copied after the builtin static files,
116# so a file named "default.css" will overwrite the builtin "default.css".
117html_static_path = ['_static']
118
119# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
120on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
121
122if not on_rtd: # only import and set the theme if we're building docs locally
123 # Override default css to get a larger width for local build
124 def setup(app):
125 app.add_css_file('css/osqp_theme.css')
126else:
127 html_context = {
128 'css_files': [
129 'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
130 'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
131 '_static/css/osqp_theme.css'],
132 }
133
134
135
136# -- Options for HTMLHelp output ------------------------------------------
137
138# Output file base name for HTML help builder.
139htmlhelp_basename = 'OSQPdoc'
140
141
142# -- Options for LaTeX output ---------------------------------------------
143
144latex_elements = {
145 # The paper size ('letterpaper' or 'a4paper').
146 #
147 # 'papersize': 'letterpaper',
148
149 # The font size ('10pt', '11pt' or '12pt').
150 #
151 # 'pointsize': '10pt',
152
153 # Additional stuff for the LaTeX preamble.
154 #
155 # 'preamble': '',
156
157 # Latex figure (float) alignment
158 #
159 # 'figure_align': 'htbp',
160 'sphinxsetup': 'hmargin={1.5cm,1.5cm}',
161}
162
163# Grouping the document tree into LaTeX files. List of tuples
164# (source start file, target name, title,
165# author, documentclass [howto, manual, or own class]).
166latex_documents = [
167 (master_doc, 'OSQP.tex', 'OSQP Documentation',
168 'Bartolomeo Stellato, Goran Banjac', 'manual'),
169]
170
171
172# -- Options for manual page output ---------------------------------------
173
174# One entry per manual page. List of tuples
175# (source start file, name, description, authors, manual section).
176man_pages = [
177 (master_doc, 'OSQP', 'OSQP Documentation',
178 [author], 1)
179]
180
181# -- Options for breathe ---------------------------------------
182
183# Generate doxygen documentation
184subprocess.call('doxygen doxygen.conf', shell=True)
185
186breathe_projects = {"osqp": "doxygen_out/xml/"}
187breathe_default_project = "osqp"
188
189
190
191# -- Options for Texinfo output -------------------------------------------
192
193# Grouping the document tree into Texinfo files. List of tuples
194# (source start file, target name, title, author,
195# dir menu entry, description, category)
196texinfo_documents = [
197 (master_doc, 'OSQP', 'OSQP Documentation',
198 author, 'OSQP', 'One line description of project.',
199 'Miscellaneous'),
200]