Skip to content

Commit 86097fc

Browse files
committed
[feat] Convert the documentation to Read The Docs template
Following changes were made in this commit - - Sphinx's `conf.py` file was regenerated. Old configuration file is in `conf_old.py` - `custom.css` was added to set sidebar colors - `documentation.rst` page was added to serve as the home page for docs. Replaces the old `documentation.html`. - Some `rst` files were modified to reduce the number of sidebar pages Signed-off-by: Anmol Mishra <[email protected]>
1 parent 34ad25d commit 86097fc

9 files changed

+453
-233
lines changed

doc/sphinxdoc/_static/css/custom.css

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
div.wy-side-scroll {
2+
background: #0b3954;
3+
}
4+
5+
6+
div.wy-side-nav-search {
7+
background: #0b3954;
8+
}
9+
10+
div.wy-side-nav-search .version {
11+
color: rgba(255, 255, 255, 0.7);
12+
}
13+
14+
div.wy-menu.wy-menu-vertical {
15+
background: #0b3954;
16+
}
17+
18+
19+
span.caption-text {
20+
color: #404040;
21+
}
22+
23+
div.wy-menu .caption-text {
24+
color: #C8152F;
25+
}

doc/sphinxdoc/algorithms_overview.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ as well as a small description.
77

88
Please note that this is not an exhaustive list but rather a quick overview of the most used
99
algorithms in Essentia. For the full list of algorithms and their detailed documentation,
10-
please see the `complete reference <algorithms_reference.html>`_.
10+
please see the :doc:`complete reference <algorithms_reference>`.
1111

1212

1313
Audio input / output

doc/sphinxdoc/coding_guidelines.rst

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. highlight:: cpp
22

3-
General development guidelines
4-
==============================
3+
Coding Guidelines
4+
=================
55

66
Fixing bugs
77
-----------
@@ -22,9 +22,6 @@ Doing commits in Github
2222
humorous in them, but messages such as "bsdjfh" are *not* allowed.
2323

2424

25-
Coding Guidelines
26-
=================
27-
2825
Coding style guidelines
2926
-----------------------
3027

doc/sphinxdoc/conf.py

+35-223
Original file line numberDiff line numberDiff line change
@@ -17,252 +17,64 @@
1717
# You should have received a copy of the Affero GNU General Public License
1818
# version 3 along with this program. If not, see http://www.gnu.org/licenses/
1919

20+
# Configuration file for the Sphinx documentation builder.
2021

21-
#
22-
# Essentia documentation build configuration file, created by
23-
# sphinx-quickstart on Thu Nov 11 16:09:32 2010.
24-
#
25-
# This file is execfile()d with the current directory set to its containing dir.
26-
#
27-
# Note that not all possible configuration values are present in this
28-
# autogenerated file.
29-
#
30-
# All configuration values have a default; values that are commented out
31-
# serve to show the default.
32-
33-
import sys, os
34-
35-
# If extensions (or modules to document with autodoc) are in another directory,
36-
# add these directories to sys.path here. If the directory is relative to the
37-
# documentation root, use os.path.abspath to make it absolute, like shown here.
38-
#sys.path.insert(0, os.path.abspath('.'))
39-
40-
# -- General configuration -----------------------------------------------------
41-
42-
# If your documentation needs a minimal Sphinx version, state it here.
43-
#needs_sphinx = '1.0'
22+
# -- Project information
4423

45-
# Add any Sphinx extension module names here, as strings. They can be extensions
46-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
47-
extensions = ['sphinx.ext.viewcode',
48-
'sphinxcontrib.doxylink',
49-
# 'sphinxprettysearchresults',
50-
'sphinx.ext.autosectionlabel',
51-
'sphinx_toolbox.collapse']
52-
53-
# Add any paths that contain templates here, relative to this directory.
54-
templates_path = ['_templates']
55-
56-
# The suffix of source filenames.
57-
source_suffix = '.rst'
58-
59-
# The encoding of source files.
60-
#source_encoding = 'utf-8-sig'
61-
62-
# The master toctree document.
63-
master_doc = 'contents'
64-
65-
# General information about the project.
6624
project = u'Essentia'
67-
copyright = u'2006-2022, Universitat Pompeu Fabra'
25+
copyright = u'2006-2024, Universitat Pompeu Fabra'
26+
author = 'MTG'
6827

69-
# The version info for the project you're documenting, acts as replacement for
70-
# |version| and |release|, also used in various other places throughout the
71-
# built documents.
72-
#
73-
# The short X.Y version.
74-
version = '2.1-beta6-dev'
75-
# The full version, including alpha/beta/rc tags.
7628
release = '2.1-beta6-dev'
29+
version = '2.1-beta6-dev'
30+
root_doc = 'documentation'
7731

78-
# The language for content autogenerated by Sphinx. Refer to documentation
79-
# for a list of supported languages.
80-
#language = None
32+
# -- General configuration
8133

82-
# There are two options for replacing |today|: either, you set today to some
83-
# non-false value, then it is used:
84-
#today = ''
85-
# Else, today_fmt is used as the format for a strftime call.
86-
#today_fmt = '%B %d, %Y'
34+
extensions = [
35+
'sphinx.ext.duration',
36+
'sphinx.ext.doctest',
37+
'sphinx.ext.autodoc',
38+
'sphinx.ext.autosummary',
39+
'sphinx.ext.intersphinx',
40+
]
8741

88-
# List of patterns, relative to source directory, that match files and
89-
# directories to ignore when looking for source files.
42+
# -- Options for HTML output
43+
templates_path = ['_templates']
9044
exclude_patterns = ['_build']
9145

92-
# The reST default role (used for this markup: `text`) to use for all documents.
93-
#default_role = None
94-
95-
# If true, '()' will be appended to :func: etc. cross-reference text.
96-
#add_function_parentheses = True
97-
98-
# If true, the current module name will be prepended to all description
99-
# unit titles (such as .. function::).
100-
#add_module_names = True
101-
102-
# If true, sectionauthor and moduleauthor directives will be shown in the
103-
# output. They are ignored by default.
104-
#show_authors = False
105-
106-
# The name of the Pygments (syntax highlighting) style to use.
107-
pygments_style = 'friendly'
108-
109-
# A list of ignored prefixes for module index sorting.
110-
#modindex_common_prefix = []
111-
112-
113-
# -- Options for HTML output ---------------------------------------------------
114-
11546
# The theme to use for HTML and HTML Help pages. See the documentation for
11647
# a list of builtin themes.
117-
html_theme = 'sphinxdoc_mtg'
118-
119-
# If true, the text around the keyword is shown as summary of each search result.
120-
# Default is True.
121-
html_show_search_summary = False
122-
123-
# Add any paths that contain custom themes here, relative to this directory.
124-
html_theme_path = ['_templates']
125-
126-
# Theme options are theme-specific and customize the look and feel of a theme
127-
# further. For a list of options available for each theme, see the
128-
# documentation.
48+
#
49+
html_theme = "sphinx_rtd_theme"
12950
html_theme_options = {
130-
"nosidebar": "false",
51+
'logo_only': True,
13152
}
13253

133-
134-
# The name for this set of Sphinx documents. If None, it defaults to
135-
# "<project> v<release> documentation".
136-
#html_title = None
137-
138-
# A shorter title for the navigation bar. Default is the same as html_title.
139-
#html_short_title = None
140-
141-
# The name of an image file (relative to this directory) to place at the top
142-
# of the sidebar.
143-
#html_logo = None
144-
#html_logo = 'mtg_logo.png'
145-
146-
# The name of an image file (within the static path) to use as favicon of the
147-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
148-
# pixels large.
149-
html_favicon = 'favicon.ico'
150-
15154
# Add any paths that contain custom static files (such as style sheets) here,
15255
# relative to this directory. They are copied after the builtin static files,
15356
# so a file named "default.css" will overwrite the builtin "default.css".
154-
html_static_path = ['_static']
155-
156-
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
157-
# using the given strftime format.
158-
#html_last_updated_fmt = '%b %d, %Y'
57+
html_static_path = ["_static"]
58+
html_css_files = [
59+
"css/custom.css",
60+
]
61+
html_logo = "_static/essentia_logo.svg"
15962

160-
# If true, SmartyPants will be used to convert quotes and dashes to
161-
# typographically correct entities.
162-
#html_use_smartypants = True
63+
# -- Options for EPUB output
64+
epub_show_urls = 'footnote'
16365

164-
# Custom sidebar templates, maps document names to template names.
165-
#html_sidebars = { 'index': [ 'indexsidebar.html', 'searchbox.html' ] }
166-
#html_sidebars = { '**': [] } # disable sidebar on all pages
167-
168-
# We only want a sidebar on the models page.
169-
html_sidebars = {
170-
# 'index': [],
171-
'**': [],
172-
'algorithms_reference': ['localtoc.html'],
173-
'models': ['localtoc.html'],
174-
}
66+
# Sidebar templates
67+
# html_sidebars = {
68+
# '**': []
69+
# }
17570

17671
# Additional templates that should be rendered to pages, maps page names to
17772
# template names.
178-
html_additional_pages = {'index': 'index.html',
179-
# 'algorithms_reference': 'algorithms_reference.html',
73+
html_additional_pages = {
74+
# 'index': 'index.html',
18075
'applications': 'applications.html',
181-
'documentation': 'documentation.html'}
182-
183-
# Deprecating this. Generating algorithm docs directly from rst files is better for sidebar.
184-
# exec(compile(open("essentia_reference.py").read(), "essentia_reference.py", 'exec'))
185-
# html_additional_pages.update(essentia_algorithms)
186-
187-
# If false, no module index is generated.
188-
#html_domain_indices = True
189-
190-
# If false, no index is generated.
191-
html_use_index = False
192-
193-
# If true, the index is split into individual pages for each letter.
194-
#html_split_index = False
195-
196-
# If true, links to the reST sources are added to the pages.
197-
#html_show_sourcelink = True
198-
199-
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
200-
#html_show_sphinx = True
201-
202-
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
203-
#html_show_copyright = True
204-
205-
# If true, an OpenSearch description file will be output, and all pages will
206-
# contain a <link> tag referring to it. The value of this option must be the
207-
# base URL from which the finished HTML is served.
208-
#html_use_opensearch = ''
209-
210-
# This is the file name suffix for HTML files (e.g. ".xhtml").
211-
#html_file_suffix = None
212-
213-
# Output file base name for HTML help builder.
214-
htmlhelp_basename = 'Essentiadoc'
76+
# 'documentation': 'documentation.html',
77+
}
21578

79+
# html_extra_path = ['./_templates/index.html']
21680

217-
# -- Options for LaTeX output --------------------------------------------------
218-
219-
# The paper size ('letter' or 'a4').
220-
#latex_paper_size = 'letter'
221-
222-
# The font size ('10pt', '11pt' or '12pt').
223-
#latex_font_size = '10pt'
224-
225-
# Grouping the document tree into LaTeX files. List of tuples
226-
# (source start file, target name, title, author, documentclass [howto/manual]).
227-
#latex_documents = [
228-
# ('index', 'Essentia.tex', u'Essentia Documentation',
229-
# u'Nicolas Wack', 'manual'),
230-
#]
231-
232-
# The name of an image file (relative to this directory) to place at the top of
233-
# the title page.
234-
#latex_logo = None
235-
236-
# For "manual" documents, if this is true, then toplevel headings are parts,
237-
# not chapters.
238-
#latex_use_parts = False
239-
240-
# If true, show page references after internal links.
241-
#latex_show_pagerefs = False
242-
243-
# If true, show URL addresses after external links.
244-
#latex_show_urls = False
245-
246-
# Additional stuff for the LaTeX preamble.
247-
#latex_preamble = ''
248-
249-
# Documents to append as an appendix to all manuals.
250-
#latex_appendices = []
251-
252-
# If false, no module index is generated.
253-
#latex_domain_indices = True
254-
255-
256-
# -- Options for manual page output --------------------------------------------
257-
258-
# One entry per manual page. List of tuples
259-
# (source start file, name, description, authors, manual section).
260-
#man_pages = [
261-
# ('index', 'essentia', u'Essentia Documentation',
262-
# [u'Nicolas Wack'], 1)
263-
#]
264-
265-
266-
doxylink = {
267-
'essentia': ('EssentiaDoxygen.tag', 'doxygen')
268-
}

0 commit comments

Comments
 (0)