|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 | # -*- coding: utf-8 -*-
|
3 | 3 | #
|
4 |
| -# Copyright (C) 2017-2021 F4PGA Authors. |
| 4 | +# Copyright (C) 2017-2022 F4PGA Authors. |
5 | 5 | #
|
6 | 6 | # Licensed under the Apache License, Version 2.0 (the "License");
|
7 | 7 | # you may not use this file except in compliance with the License.
|
|
17 | 17 | #
|
18 | 18 | # SPDX-License-Identifier: Apache-2.0
|
19 | 19 |
|
20 |
| -# Interchange-schema documentation build configuration file, |
21 |
| -# created by sphinx-quickstart on Mon Feb 5 11:04:37 2018. |
22 |
| -# |
23 |
| -# This file is execfile()d with the current directory set to its |
24 |
| -# containing dir. |
25 |
| -# |
26 |
| -# Note that not all possible configuration values are present in this |
27 |
| -# autogenerated file. |
28 |
| -# |
29 |
| -# All configuration values have a default; values that are commented out |
30 |
| -# serve to show the default. |
| 20 | +# Updated documentation of the configuration options is available at |
| 21 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
31 | 22 |
|
32 |
| -import re |
| 23 | +from re import sub as re_sub |
| 24 | +from os import path as os_path, environ, popen |
| 25 | +from sys import path as sys_path |
33 | 26 |
|
34 |
| -# If extensions (or modules to document with autodoc) are in another directory, |
35 |
| -# add these directories to sys.path here. If the directory is relative to the |
36 |
| -# documentation root, use os.path.abspath to make it absolute, like shown here. |
37 |
| -# |
38 |
| -import os |
39 |
| -import sys |
40 |
| -sys.path.insert(0, os.path.abspath('.')) |
| 27 | +sys_path.insert(0, os_path.abspath('.')) |
41 | 28 |
|
42 | 29 | # -- General configuration ------------------------------------------------
|
43 | 30 |
|
44 |
| -# If your documentation needs a minimal Sphinx version, state it here. |
45 |
| -# |
46 |
| -# needs_sphinx = '1.0' |
| 31 | +project = 'FPGA Interchange Format' |
| 32 | +copyright = '2022, F4PGA Developers' |
| 33 | +author = 'F4PGA Developers' |
47 | 34 |
|
48 |
| -# Add any Sphinx extension module names here, as strings. They can be |
49 |
| -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
50 |
| -# ones. |
51 | 35 | extensions = [
|
52 | 36 | 'sphinx.ext.autodoc',
|
53 | 37 | 'sphinx.ext.autosummary',
|
54 | 38 | 'sphinx.ext.doctest',
|
55 | 39 | 'sphinx.ext.imgmath',
|
| 40 | + 'sphinx.ext.intersphinx', |
56 | 41 | 'sphinx.ext.napoleon',
|
57 | 42 | 'sphinx.ext.todo',
|
58 | 43 | 'sphinx_markdown_tables',
|
59 | 44 | 'recommonmark',
|
60 | 45 | ]
|
61 | 46 |
|
62 |
| -# Add any paths that contain templates here, relative to this directory. |
63 | 47 | templates_path = ['_templates']
|
64 | 48 |
|
65 |
| -# The suffix(es) of source filenames. |
66 |
| -# You can specify multiple suffix as a list of string: |
67 | 49 | source_suffix = ['.rst', '.md']
|
68 | 50 |
|
69 |
| -# The master toctree document. |
70 | 51 | master_doc = 'index'
|
71 | 52 |
|
72 |
| -# General information about the project. |
73 |
| -project = u'FPGA Interchange Format' |
74 |
| -copyright = u'2022, F4PGA Developers' |
75 |
| -author = u'F4PGA Developers' |
76 |
| - |
77 |
| -# Enable github links when not on readthedocs |
78 |
| -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' |
79 |
| -if not on_rtd: |
80 |
| - html_context = { |
81 |
| - "display_github": True, # Integrate GitHub |
82 |
| - "github_user": "chipsalliance", # Username |
83 |
| - "github_repo": "fpga-interchange-schema", # Repo name |
84 |
| - "github_version": "master", # Version |
85 |
| - "conf_py_path": "/docs/", |
86 |
| - } |
87 |
| -else: |
88 |
| - docs_dir = os.path.abspath(os.path.dirname(__file__)) |
| 53 | +on_rtd = environ.get('READTHEDOCS', None) == 'True' |
| 54 | + |
| 55 | +if on_rtd: |
| 56 | + docs_dir = os_path.abspath(os_path.dirname(__file__)) |
89 | 57 | print("Docs dir is:", docs_dir)
|
90 | 58 | import subprocess
|
91 | 59 | subprocess.call('git fetch origin --unshallow', cwd=docs_dir, shell=True)
|
92 | 60 | subprocess.check_call('git fetch origin --tags', cwd=docs_dir, shell=True)
|
93 | 61 |
|
94 |
| -# The version info for the project you're documenting, acts as replacement for |
95 |
| -# |version| and |release|, also used in various other places throughout the |
96 |
| -# built documents. |
97 |
| -# |
98 |
| -# The full version, including alpha/beta/rc tags. |
99 |
| -release = re.sub('^v', '', os.popen('git describe').read().strip()) |
100 |
| -# The short X.Y version. |
| 62 | +release = re_sub('^v', '', popen('git describe').read().strip()) |
101 | 63 | version = release
|
102 | 64 |
|
103 |
| -# The language for content autogenerated by Sphinx. Refer to documentation |
104 |
| -# for a list of supported languages. |
105 |
| -# |
106 |
| -# This is also used if you do content translation via gettext catalogs. |
107 |
| -# Usually you set "language" from the command line for these cases. |
108 | 65 | language = None
|
109 | 66 |
|
110 |
| -# List of patterns, relative to source directory, that match files and |
111 |
| -# directories to ignore when looking for source files. |
112 |
| -# This patterns also effect to html_static_path and html_extra_path |
113 |
| -exclude_patterns = ['_build', 'env', 'Thumbs.db', '.DS_Store'] |
| 67 | +exclude_patterns = [ |
| 68 | + '_build', |
| 69 | + 'env', |
| 70 | + 'Thumbs.db', |
| 71 | + '.DS_Store' |
| 72 | +] |
114 | 73 |
|
115 |
| -# The name of the Pygments (syntax highlighting) style to use. |
116 | 74 | pygments_style = 'default'
|
117 | 75 |
|
118 |
| -# If true, `todo` and `todoList` produce output, else they produce nothing. |
119 | 76 | todo_include_todos = True
|
120 | 77 |
|
121 | 78 | # -- Options for HTML output ----------------------------------------------
|
122 | 79 |
|
123 |
| -# The theme to use for HTML and HTML Help pages. See the documentation for |
124 |
| -# a list of builtin themes. |
125 |
| -# |
126 | 80 | html_theme = 'sphinx_symbiflow_theme'
|
127 | 81 |
|
128 |
| -# Theme options are theme-specific and customize the look and feel of a theme |
129 |
| -# further. For a list of options available for each theme, see the |
130 |
| -# documentation. |
131 |
| -# |
132 | 82 | html_theme_options = {
|
133 | 83 | 'repo_name': 'chipsalliance/fpga-interchange-schema',
|
134 | 84 | 'github_url': 'https://github.com/chipsalliance/fpga-interchange-schema',
|
135 | 85 | 'color_primary': 'indigo',
|
136 | 86 | 'color_accent': 'blue',
|
137 | 87 | }
|
138 | 88 |
|
139 |
| -# Add any paths that contain custom static files (such as style sheets) here, |
140 |
| -# relative to this directory. They are copied after the builtin static files, |
141 |
| -# so a file named "default.css" will overwrite the builtin "default.css". |
142 | 89 | html_static_path = ['_static']
|
143 | 90 |
|
144 |
| -# Custom sidebar templates, must be a dictionary that maps document names |
145 |
| -# to template names. |
146 |
| -# |
147 |
| -# This is required for the alabaster theme |
148 |
| -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars |
149 |
| -html_sidebars = { |
150 |
| - '**': [ |
151 |
| - 'relations.html', # needs 'show_related': True theme option to display |
152 |
| - 'searchbox.html', |
153 |
| - ] |
154 |
| -} |
155 |
| - |
156 | 91 | # -- Options for HTMLHelp output ------------------------------------------
|
157 | 92 |
|
158 |
| -# Output file base name for HTML help builder. |
159 | 93 | htmlhelp_basename = 'fpga-interchange-schema'
|
160 | 94 |
|
161 | 95 | # -- Options for LaTeX output ---------------------------------------------
|
162 | 96 |
|
163 |
| -latex_elements = { |
164 |
| - # The paper size ('letterpaper' or 'a4paper'). |
165 |
| - # |
166 |
| - # 'papersize': 'letterpaper', |
167 |
| - |
168 |
| - # The font size ('10pt', '11pt' or '12pt'). |
169 |
| - # |
170 |
| - # 'pointsize': '10pt', |
| 97 | +latex_elements = {} |
171 | 98 |
|
172 |
| - # Additional stuff for the LaTeX preamble. |
173 |
| - # |
174 |
| - # 'preamble': '', |
175 |
| - |
176 |
| - # Latex figure (float) alignment |
177 |
| - # |
178 |
| - # 'figure_align': 'htbp', |
179 |
| -} |
180 |
| - |
181 |
| -# Grouping the document tree into LaTeX files. List of tuples |
182 |
| -# (source start file, target name, title, |
183 |
| -# author, documentclass [howto, manual, or own class]). |
184 | 99 | latex_documents = [
|
185 | 100 | (
|
186 | 101 | master_doc,
|
|
193 | 108 |
|
194 | 109 | # -- Options for manual page output ---------------------------------------
|
195 | 110 |
|
196 |
| -# One entry per manual page. List of tuples |
197 |
| -# (source start file, name, description, authors, manual section). |
198 | 111 | man_pages = [
|
199 | 112 | (
|
200 | 113 | master_doc,
|
|
207 | 120 |
|
208 | 121 | # -- Options for Texinfo output -------------------------------------------
|
209 | 122 |
|
210 |
| -# Grouping the document tree into Texinfo files. List of tuples |
211 |
| -# (source start file, target name, title, author, |
212 |
| -# dir menu entry, description, category) |
213 | 123 | texinfo_documents = [
|
214 | 124 | (
|
215 | 125 | master_doc,
|
|
222 | 132 | ),
|
223 | 133 | ]
|
224 | 134 |
|
225 |
| -# Example configuration for intersphinx: refer to the Python standard library. |
226 |
| -intersphinx_mapping = {'https://docs.python.org/': None} |
| 135 | +# -- Sphinx.Ext.InterSphinx ----------------------------------------------- |
227 | 136 |
|
228 |
| - |
229 |
| -def setup(app): |
230 |
| - pass |
| 137 | +intersphinx_mapping = { |
| 138 | + "python": ("https://docs.python.org/3/", None), |
| 139 | +} |
0 commit comments