Skip to content

Commit 7eed37d

Browse files
committed
docs/conf: cleanup
Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
1 parent b0adf80 commit 7eed37d

File tree

1 file changed

+27
-118
lines changed

1 file changed

+27
-118
lines changed

docs/conf.py

Lines changed: 27 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (C) 2017-2021 F4PGA Authors.
4+
# Copyright (C) 2017-2022 F4PGA Authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -17,170 +17,85 @@
1717
#
1818
# SPDX-License-Identifier: Apache-2.0
1919

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
3122

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
3326

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('.'))
4128

4229
# -- General configuration ------------------------------------------------
4330

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'
4734

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.
5135
extensions = [
5236
'sphinx.ext.autodoc',
5337
'sphinx.ext.autosummary',
5438
'sphinx.ext.doctest',
5539
'sphinx.ext.imgmath',
40+
'sphinx.ext.intersphinx',
5641
'sphinx.ext.napoleon',
5742
'sphinx.ext.todo',
5843
'sphinx_markdown_tables',
5944
'recommonmark',
6045
]
6146

62-
# Add any paths that contain templates here, relative to this directory.
6347
templates_path = ['_templates']
6448

65-
# The suffix(es) of source filenames.
66-
# You can specify multiple suffix as a list of string:
6749
source_suffix = ['.rst', '.md']
6850

69-
# The master toctree document.
7051
master_doc = 'index'
7152

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__))
8957
print("Docs dir is:", docs_dir)
9058
import subprocess
9159
subprocess.call('git fetch origin --unshallow', cwd=docs_dir, shell=True)
9260
subprocess.check_call('git fetch origin --tags', cwd=docs_dir, shell=True)
9361

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())
10163
version = release
10264

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.
10865
language = None
10966

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+
]
11473

115-
# The name of the Pygments (syntax highlighting) style to use.
11674
pygments_style = 'default'
11775

118-
# If true, `todo` and `todoList` produce output, else they produce nothing.
11976
todo_include_todos = True
12077

12178
# -- Options for HTML output ----------------------------------------------
12279

123-
# The theme to use for HTML and HTML Help pages. See the documentation for
124-
# a list of builtin themes.
125-
#
12680
html_theme = 'sphinx_symbiflow_theme'
12781

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-
#
13282
html_theme_options = {
13383
'repo_name': 'chipsalliance/fpga-interchange-schema',
13484
'github_url': 'https://github.com/chipsalliance/fpga-interchange-schema',
13585
'color_primary': 'indigo',
13686
'color_accent': 'blue',
13787
}
13888

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".
14289
html_static_path = ['_static']
14390

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-
15691
# -- Options for HTMLHelp output ------------------------------------------
15792

158-
# Output file base name for HTML help builder.
15993
htmlhelp_basename = 'fpga-interchange-schema'
16094

16195
# -- Options for LaTeX output ---------------------------------------------
16296

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 = {}
17198

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]).
18499
latex_documents = [
185100
(
186101
master_doc,
@@ -193,8 +108,6 @@
193108

194109
# -- Options for manual page output ---------------------------------------
195110

196-
# One entry per manual page. List of tuples
197-
# (source start file, name, description, authors, manual section).
198111
man_pages = [
199112
(
200113
master_doc,
@@ -207,9 +120,6 @@
207120

208121
# -- Options for Texinfo output -------------------------------------------
209122

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)
213123
texinfo_documents = [
214124
(
215125
master_doc,
@@ -222,9 +132,8 @@
222132
),
223133
]
224134

225-
# Example configuration for intersphinx: refer to the Python standard library.
226-
intersphinx_mapping = {'https://docs.python.org/': None}
135+
# -- Sphinx.Ext.InterSphinx -----------------------------------------------
227136

228-
229-
def setup(app):
230-
pass
137+
intersphinx_mapping = {
138+
"python": ("https://docs.python.org/3/", None),
139+
}

0 commit comments

Comments
 (0)