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

use gallery style and update doc #22

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,10 @@ ENV/

# OS stuff
.DS_Store

# ignore downloads from pyfar gallery
docs/header.rst
docs/_static/favicon.ico
docs/_static/header.rst
docs/_static/css/custom.css
docs/resources/logos/pyfar_logos_fixed_size_imkar.png
164 changes: 99 additions & 65 deletions CONTRIBUTING.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
History
=======

0.1.0 (2022-09-19)
0.1.0 (2024-03-28)
------------------

* First release on PyPI.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022, The pyfar developers
Copyright (c) 2024, The pyfar developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include AUTHORS.rst
include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
Expand Down
22 changes: 13 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@ imkar
=====


.. image:: https://img.shields.io/pypi/v/imkar.svg
:target: https://pypi.python.org/pypi/imkar
.. image:: https://badge.fury.io/py/imkar.svg
:target: https://badge.fury.io/py/imkar
.. image:: https://readthedocs.org/projects/imkar/badge/?version=latest
:target: https://imkar.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://circleci.com/gh/pyfar/imkar.svg?style=shield
:target: https://circleci.com/gh/pyfar/imkar

.. image:: https://img.shields.io/cirrus/github/pyfar/imkar.svg
:target: https://app.circleci.com/pipelines/github/pyfar/imkar

.. image:: https://readthedocs.org/projects/imkar/badge/?version=latest
:target: https://imkar.readthedocs.io/en/latest/?version=latest
:alt: Documentation Status


A python package for material modeling and quantification in acoustics.


* Free software: MIT license


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

Check out `read the docs`_ for the complete documentation. Packages
related to imkar are listed at `pyfar.org`_.
related to pyfar are listed at `pyfar.org`_.

Installation
============
Expand All @@ -39,6 +43,6 @@ Contributing
Refer to the `contribution guidelines`_ for more information.


.. _contribution guidelines: https://github.com/pyfar/imkar/blob/main/CONTRIBUTING.rst
.. _contribution guidelines: https://github.com/pyfar/imkar/blob/develop/CONTRIBUTING.rst
ahms5 marked this conversation as resolved.
Show resolved Hide resolved
.. _pyfar.org: https://pyfar.org
.. _read the docs: https://imkar.readthedocs.io/en/latest
190 changes: 84 additions & 106 deletions docs/conf.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# imkar 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
import urllib3
import shutil
sys.path.insert(0, os.path.abspath('..'))

import imkar # 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',
'sphinx.ext.napoleon',
'sphinx.ext.autosummary',
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.mathjax',
'autodocsumm']
'sphinx.ext.intersphinx',
'autodocsumm',
'sphinx_design',
'sphinx_favicon',
'sphinx_reredirects',
]

# show tocs for classes and functions of modules using the autodocsumm
# package
Expand All @@ -49,20 +40,18 @@
plot_include_source = True

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

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

# The master toctree document.
master_doc = 'index'

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

# The version info for the project you're documenting, acts as replacement
Expand All @@ -74,9 +63,6 @@
# The full version, including alpha/beta/rc tags.
release = imkar.__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'
Expand All @@ -99,82 +85,74 @@
# default language for highlighting in source code
highlight_language = "python3"

# -- 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 = 'pydata_sphinx_theme'

# 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']

# intersphinx mapping
intersphinx_mapping = {
'numpy': ('https://numpy.org/doc/stable/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
'matplotlib': ('https://matplotlib.org/stable/', None),
'pyfar': ('https://pyfar.readthedocs.io/en/stable/', None),
}

# -- Options for HTMLHelp output ---------------------------------------
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

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


# -- 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',
html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
html_css_files = ['css/custom.css']
html_logo = 'resources/logos/pyfar_logos_fixed_size_imkar.png'
html_title = "imkar"
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", "theme-switcher"],
"navbar_align": "content",
"header_links_before_dropdown": 8,
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/pyfar",
"icon": "fa-brands fa-square-github",
"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, 'imkar.tex',
'imkar Documentation',
'The pyfar developers', '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, 'imkar',
'imkar Documentation',
[author], 1)
]

html_context = {
"default_mode": "light"
}

# -- Options for Texinfo output ----------------------------------------
# redirect index to pyfar.html
redirects = {
"index": "imkar.html"
}

# 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, 'imkar',
'imkar Documentation',
author,
'imkar',
'One line description of project.',
'Miscellaneous'),
]
# -- download navbar and style files from gallery -----------------------------
branch = 'add-imkar'
link = f'https://github.com/pyfar/gallery/raw/{branch}/docs/'
folders_in = [
'_static/css/custom.css',
'_static/favicon.ico',
'_static/header.rst',
'resources/logos/pyfar_logos_fixed_size_imkar.png',
]
c = urllib3.PoolManager()
for file in folders_in:
url = link + file
filename = file
os.makedirs(os.path.dirname(filename), exist_ok=True)
with c.request('GET', url, preload_content=False) as res, open(filename, 'wb') as out_file:
shutil.copyfileobj(res, out_file)

# replace pyfar hard link to internal link
with open("_static/header.rst", "rt") as fin:
with open("header.rst", "wt") as fout:
for line in fin:
fout.write(line.replace(f'https://{project}.readthedocs.io', project))
29 changes: 29 additions & 0 deletions docs/imkar.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
imkar
=====

.. toctree::
:caption: Getting Started
:maxdepth: 2

readme


.. toctree::
:caption: Documentation
:maxdepth: 2

modules


.. toctree::
:caption: Contributing
:maxdepth: 1

contributing


.. toctree::
:caption: Other
:maxdepth: 1

history
38 changes: 1 addition & 37 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,2 @@
Getting Started
===============

.. toctree::
:maxdepth: 2

readme

Documentation
=============

.. toctree::
:maxdepth: 2

modules

Contributing
============

.. toctree::
:maxdepth: 2

contributing

Other
=====
.. toctree::
:maxdepth: 1

history

..
(removed because it is contained in the new spinx style)
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. include:: header.rst
Loading