Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
123 changes: 64 additions & 59 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,90 +1,87 @@
# -*- coding: utf-8 -*-
import sys
import os

import pydata_sphinx_theme # Pydata theme: https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html

import sys
from importlib.metadata import metadata
project='visualea'
meta = metadata('openalea.' + project)

project = "visualea"
meta = metadata("openalea." + project)
release = meta.get("version")
# for example take major/minor
version = ".".join(release.split('.')[:3])
author = meta['Author'].split(' <')[0]
desc = meta['Summary']
urls = {k:v for k,v in [item.split(',') for item in meta.get_all('Project-URL')]}
version = ".".join(release.split(".")[:3])
author = meta["Author"].split(" <")[0]
desc = meta["Summary"]
urls = {k: v for k, v in [item.split(",") for item in meta.get_all("Project-URL")]}


# 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.
# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..')) # to include the root of the package
sys.path.insert(0, os.path.abspath("..")) # to include the root of the package

# -- General configuration ------------------------------------------------
# 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', # support for automatic inclusion of docstring
'sphinx.ext.autosummary', # generates autodoc summaries
'sphinx.ext.doctest', # inclusion and testing of doctest code snippets
'sphinx.ext.intersphinx', # support for linking to other projects
'sphinx.ext.mathjax', # support for math equations
'sphinx.ext.ifconfig', # support for conditional content
'sphinx.ext.viewcode', # support for links to source code
'sphinx.ext.coverage', # includes doc coverage stats in the documentation
'sphinx.ext.todo', # support for todo items
'sphinx.ext.napoleon', # support for numpy and google style docstrings
"sphinx_favicon", # support for favicon
"sphinx_copybutton", # support for copybutton in code blocks
"nbsphinx", # for integrating jupyter notebooks
"myst_parser" # for parsing .md files
"sphinx.ext.autodoc", # support for automatic inclusion of docstring
"sphinx.ext.autosummary", # generates autodoc summaries
"sphinx.ext.doctest", # inclusion and testing of doctest code snippets
"sphinx.ext.intersphinx", # support for linking to other projects
"sphinx.ext.mathjax", # support for math equations
"sphinx.ext.ifconfig", # support for conditional content
"sphinx.ext.viewcode", # support for links to source code
"sphinx.ext.coverage", # includes doc coverage stats in the documentation
"sphinx.ext.todo", # support for todo items
"sphinx.ext.napoleon", # support for numpy and google style docstrings
"sphinx_favicon", # support for favicon
"sphinx_copybutton", # support for copybutton in code blocks
"nbsphinx", # for integrating jupyter notebooks
"myst_parser", # for parsing .md files
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
autosummary_generate = True
exclude_patterns = ['build', '_build', '_templates']
exclude_patterns = ["build", "_build", "_templates"]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
".rst": "restructuredtext",
".md": "markdown",
}
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
copyright = u'Cecill-C INRAE / INRIA / CIRAD'
copyright = "Cecill-C INRAE / INRIA / CIRAD"
# 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"
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- 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'
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 = {
"header_links_before_dropdown": 6,
"sidebarwidth": 200,
"sticky_navigation": "false",
"collapse_navigation": "false",
"display_version": "true",
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/openalea/visualea", # do not want urls['Repository']
"icon": "fa-brands fa-github",
},
"header_links_before_dropdown": 6,
"sidebarwidth": 200,
"navbar_end": ["version-switcher", "navbar-icon-links"],
"collapse_navigation": "false",
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/openalea/visualea", # do not want urls['Repository']
"icon": "fa-brands fa-github",
},
],
"show_version_warning_banner": True,
"footer_start": ["copyright"],
Expand All @@ -94,11 +91,11 @@
"examples/no-sidebar": [],
},
"use_edit_page_button": True,
}
}
# 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']
html_static_path = ["_static"]
html_logo = "_static/openalea_web.svg"
html_favicon = "_static/openalea_web.svg"
# If false, no module index is generated.
Expand All @@ -114,7 +111,7 @@
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = True
# Output file base name for HTML help builder.
htmlhelp_basename = project + '_documentation'
htmlhelp_basename = project + "_documentation"
# Add infomation about github repository
html_context = {
# "github_url": "https://github.com", # or your GitHub Enterprise site
Expand All @@ -125,29 +122,37 @@
}

# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
}
latex_elements = {}
latex_documents = [
(master_doc, 'visualea.tex', u'visualea Documentation',
u'INRA / INRIA / CIRAD', 'manual'),
(
master_doc,
"visualea.tex",
"visualea Documentation",
"INRA / INRIA / CIRAD",
"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, project, project + ' Documentation',
[author], 1)
]
man_pages = [(master_doc, project, project + " Documentation", [author], 1)]

# -- 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, project, project + ' Documentation',
author, project, desc,
'Miscellaneous'),
(
master_doc,
project,
project + " Documentation",
author,
project,
desc,
"Miscellaneous",
),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/', None)}
intersphinx_mapping = {"python": ("https://docs.python.org/", None)}

2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Documentation
:maxdepth: 1
:caption: Contents:

user/manual.rst
user/tutorials.rst
user/autosum.rst
user/references.rst

Expand Down
Loading