Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt doc style from gallery #560

Merged
merged 11 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

html[data-theme="light"] {
--pst-color-primary: #18609d; /* pyfar blue as primary color */
}

html[data-theme="dark"] {
--pst-color-primary: #18609d; /* pyfar blue as primary color */
}
Binary file added docs/_static/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions docs/_templates/navbar-nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<div class="navbar-item">
<nav class="navbar-nav">
<ul class="bd-navbar-elements navbar-nav">

<li class="nav-item">
<a class="nav-link" href="https://pyfar-gallery.readthedocs.io/en/latest/">
Home
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://pyfar-gallery.readthedocs.io/en/latest/examples_gallery.html">
Examples
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://pyfar.readthedocs.io/en/stable/">
pyfar
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://sofar.readthedocs.io/en/stable/">
sofar
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://spharpy.readthedocs.io/en/latest/">
spharpy
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="https://pyrato.readthedocs.io/en/latest/">
pyrato
</a>
</li>
</ul>
</nav></div>
206 changes: 105 additions & 101 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# pyfar documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

import pyfar # noqa

# -- General configuration ---------------------------------------------
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
Expand All @@ -40,7 +23,10 @@
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'autodocsumm']
'autodocsumm',
'sphinx_design',
'sphinx_favicon',
]

# show tocs for classes and functions of modules using the autodocsumm
# package
Expand All @@ -63,9 +49,9 @@
master_doc = 'index'

# General information about the project.
project = u'pyfar'
copyright = u"2020-2022, The pyfar developers"
author = u"The pyfar developers"
project = 'pyfar'
copyright = '2020-2024, The pyfar developers'
author = 'The pyfar developers'

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand All @@ -76,16 +62,21 @@
# The full version, including alpha/beta/rc tags.
release = pyfar.__version__


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'


# List of patterns, relative to source directory, that match files and
templates_path = ['_templates']
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path


exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use (Not defining
Expand All @@ -109,85 +100,98 @@
'spharpy': ('https://spharpy.readthedocs.io/en/stable/', None)
}

# -- Options for HTML output -------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'insipid'

# Theme options are theme-specific and customize the look and feel of a
# theme further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']


# -- Options for HTMLHelp output ---------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'pyfardoc'


# -- Options for LaTeX output ------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
html_css_files = ['css/custom.css']
html_logo = 'resources/logos/pyfar_logos_fixed_size_pyfar.png'
html_title = "pyfar"
html_favicon = '_static/favicon.ico'


# -- HTML theme options
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html

html_theme_options = {
"navbar_start": ["navbar-logo"],
"navbar_end": ["navbar-icon-links"],
"navbar_align": "content",
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/pyfar",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
},
{
"name": "CC-BY",
"url": "https://creativecommons.org/licenses/by/4.0/deed.de",
"icon": "fa-brands fa-creative-commons-by",
"type": "fontawesome",
}
],

# Configure secondary (right) side bar
"show_toc_level": 3, # Show all subsections of notebooks
"secondary_sidebar_items": ["page-toc"], # Omit 'show source' link that that
# shows notebook in json format
"navigation_with_keys": True,
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pyfar.tex',
u'pyfar Documentation',
u'Marco Berzborn', 'manual'),
]


# -- Options for manual page output ------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pyfar',
u'pyfar Documentation',
[author], 1)
]


html_context = {
"default_mode": "light"
}
# -- Options for Texinfo output ----------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pyfar',
u'pyfar Documentation',
author,
'pyfar',
'One line description of project.',
'Miscellaneous'),
]
# texinfo_documents = [
# (master_doc, 'pyfar',
# u'pyfar Gallery',
# author,
# 'pyfar',
# 'One line description of project.',
# 'Miscellaneous'),
# ]

# -- Options for nbsphinx -------------------------------------------------
nbsphinx_prolog = r"""
{% set docname = 'doc/' + env.doc2path(env.docname, base=None) %}

.. raw:: html

<div class="admonition note">
Open an interactive online version by clicking the badge
<span style="white-space: nowrap;"><a href="https://mybinder.org/v2/gh/pyfar/gallery/main?filepath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a></span>
or
<a href="{{ env.docname.split('/')|last|e + '.ipynb' }}" class="reference download internal" download>download</a>
the notebook.
<script>
if (document.location.host) {
let nbviewer_link = document.createElement('a');
nbviewer_link.setAttribute('href',
'https://nbviewer.org/url' +
(window.location.protocol == 'https:' ? 's/' : '/') +
window.location.host +
window.location.pathname.slice(0, -4) +
'ipynb');
nbviewer_link.innerHTML = 'Or view it on <em>nbviewer</em>';
nbviewer_link.classList.add('reference');
nbviewer_link.classList.add('external');
document.currentScript.replaceWith(nbviewer_link, '.');
}
</script>
</div>

"""

# -- manage thumbnails --------------------------------------------------------
# must be located in 'docs/_static'
nbsphinx_thumbnails = {
}


# -- pyfar specifics -----------------------------------------------------
Expand Down
5 changes: 1 addition & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
:width: 150
:alt: Alternative text

|pyfar_logo|


Getting Started
===============

Expand Down Expand Up @@ -35,7 +32,7 @@ Contributing
===============

.. toctree::
:maxdepth: 2
:maxdepth: 1

contributing

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ scipy>=1.5.0
matplotlib<=3.7
urllib3
deepdiff
insipid-sphinx-theme
autodocsumm
soundfile>=0.11.0
sofar>=1.1.1
nbmake>=0.7.0
pydata-sphinx-theme
sphinx-design
sphinx-favicon