11# -*- coding: utf-8 -*-
2- import os
32import sys
4- from importlib .metadata import metadata
3+ import os
4+
5+ import pydata_sphinx_theme # Pydata theme: https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html
56
6- pkg_name = 'visualea'
7- meta = metadata ('openalea.' + pkg_name )
7+ from importlib .metadata import metadata
8+ project = 'visualea'
9+ meta = metadata ('openalea.' + project )
810release = meta .get ("version" )
911# for example take major/minor
1012version = "." .join (release .split ('.' )[:3 ])
11- author = meta ['Author' ].split (', ' )[0 ] + "et al."
13+ author = meta ['Author' ].split (' < ' )[0 ]
1214desc = meta ['Summary' ]
15+ urls = {k :v for k ,v in [item .split (',' ) for item in meta .get_all ('Project-URL' )]}
16+
1317
1418# If extensions (or modules to document with autodoc) are in another directory,
1519# add these directories to sys.path here. If the directory is relative to the
1620# documentation root, use os.path.abspath to make it absolute, like shown here.
1721# sys.path.insert(0, os.path.abspath('.'))
18- sys .path .insert (0 , os .path .abspath (".." )) # to include the root of the package
22+ sys .path .insert (0 , os .path .abspath ('..' )) # to include the root of the package
1923
2024# -- General configuration ------------------------------------------------
2125# Add any Sphinx extension module names here, as strings. They can be
2226# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2327# ones.
2428extensions = [
25- "sphinx.ext.autodoc" , # support for automatic inclusion of docstring
26- "sphinx.ext.autosummary" , # generates autodoc summaries
27- "sphinx.ext.doctest" , # inclusion and testing of doctest code snippets
28- "sphinx.ext.intersphinx" , # support for linking to other projects
29- "sphinx.ext.imgmath" , # support for math equations
30- "sphinx.ext.ifconfig" , # support for conditional content
31- "sphinx.ext.viewcode" , # support for links to source code
32- "sphinx.ext.coverage" , # includes doc coverage stats in the documentation
33- "sphinx.ext.todo" , # support for todo items
34- "sphinx.ext.napoleon" , # support for numpy and google style docstrings
35- "sphinx_favicon" , # support for favicon
36- "nbsphinx" , # for integrating jupyter notebooks
37- "myst_parser" , # for parsing .md files
29+ 'sphinx.ext.autodoc' , # support for automatic inclusion of docstring
30+ 'sphinx.ext.autosummary' , # generates autodoc summaries
31+ 'sphinx.ext.doctest' , # inclusion and testing of doctest code snippets
32+ 'sphinx.ext.intersphinx' , # support for linking to other projects
33+ 'sphinx.ext.mathjax' , # support for math equations
34+ 'sphinx.ext.ifconfig' , # support for conditional content
35+ 'sphinx.ext.viewcode' , # support for links to source code
36+ 'sphinx.ext.coverage' , # includes doc coverage stats in the documentation
37+ 'sphinx.ext.todo' , # support for todo items
38+ 'sphinx.ext.napoleon' , # support for numpy and google style docstrings
39+ "sphinx_favicon" , # support for favicon
40+ "sphinx_copybutton" , # support for copybutton in code blocks
41+ "nbsphinx" , # for integrating jupyter notebooks
42+ "myst_parser" # for parsing .md files
3843]
39-
40-
41- nbsphinx_thumbnails = {
42- 'examples/Segmentation' : '_static/segmentation_thumb.png' ,
43- }
44-
45- nbsphinx_allow_errors = True
4644# Add any paths that contain templates here, relative to this directory.
47- templates_path = [" _templates" ]
45+ templates_path = [' _templates' ]
4846autosummary_generate = True
49- exclude_patterns = [" _build" , " _templates" ]
47+ exclude_patterns = ['build' , ' _build' , ' _templates' ]
5048# The suffix(es) of source filenames.
5149# You can specify multiple suffix as a list of string:
5250source_suffix = {
53- " .rst" : " restructuredtext" ,
54- " .md" : " markdown" ,
51+ ' .rst' : ' restructuredtext' ,
52+ ' .md' : ' markdown' ,
5553}
5654# The master toctree document.
57- master_doc = " index"
55+ master_doc = ' index'
5856# General information about the project.
59- project = pkg_name
60- copyright = "Cecill-C INRAE / INRIA / CIRAD"
61- author = author
62- # The version info for the project you're documenting, acts as replacement for
63- # |version| and |release|, also used in various other places throughout the
64- # built documents.
65- #
57+ copyright = u'Cecill-C INRAE / INRIA / CIRAD'
6658# The language for content autogenerated by Sphinx. Refer to documentation
6759# for a list of supported languages.
6860#
6961# This is also used if you do content translation via gettext catalogs.
7062# Usually you set "language" from the command line for these cases.
7163language = "en"
7264# The name of the Pygments (syntax highlighting) style to use.
73- pygments_style = " sphinx"
65+ pygments_style = ' sphinx'
7466# If true, `todo` and `todoList` produce output, else they produce nothing.
7567todo_include_todos = False
7668
7769# -- Options for HTML output ----------------------------------------------
7870# The theme to use for HTML and HTML Help pages. See the documentation for
7971# a list of builtin themes.
80- html_theme = " pydata_sphinx_theme"
72+ html_theme = ' pydata_sphinx_theme'
8173# Theme options are theme-specific and customize the look and feel of a theme
8274# further. For a list of options available for each theme, see the
8375# documentation.
8476html_theme_options = {
85- "header_links_before_dropdown" : 6 ,
86- "sidebarwidth" : 200 ,
87- "collapse_navigation" : "false" ,
88- "icon_links" : [
89- {
90- "name" : "GitHub" ,
91- "url" : "https://github.com/openalea/visualea" ,
92- "icon" : "fa-brands fa-github" ,
93- },
77+ "header_links_before_dropdown" : 6 ,
78+ "sidebarwidth" : 200 ,
79+ "sticky_navigation" : "false" ,
80+ "collapse_navigation" : "false" ,
81+ "display_version" : "true" ,
82+ "icon_links" : [
83+ {
84+ "name" : "GitHub" ,
85+ "url" : "https://github.com/openalea/visualea" , # do not want urls['Repository']
86+ "icon" : "fa-brands fa-github" ,
87+ },
9488 ],
9589 "show_version_warning_banner" : True ,
9690 "footer_start" : ["copyright" ],
9993 "**/*" : ["page-toc" , "edit-this-page" , "sourcelink" ],
10094 "examples/no-sidebar" : [],
10195 },
102- }
96+ "use_edit_page_button" : True ,
97+ }
10398# Add any paths that contain custom static files (such as style sheets) here,
10499# relative to this directory. They are copied after the builtin static files,
105100# so a file named "default.css" will overwrite the builtin "default.css".
106- html_static_path = [" _static" ]
101+ html_static_path = [' _static' ]
107102html_logo = "_static/openalea_web.svg"
108103html_favicon = "_static/openalea_web.svg"
109104# If false, no module index is generated.
119114# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
120115html_show_copyright = True
121116# Output file base name for HTML help builder.
122- htmlhelp_basename = "visualea_documentation"
123-
117+ htmlhelp_basename = project + '_documentation'
124118# Add infomation about github repository
125119html_context = {
126120 # "github_url": "https://github.com", # or your GitHub Enterprise site
127121 "github_user" : "openalea" ,
128122 "github_repo" : "visualea" ,
129- "github_version" : "main " ,
123+ "github_version" : "master " ,
130124 "doc_path" : "doc" ,
131125}
132126
133127# -- Options for LaTeX output ---------------------------------------------
134- latex_elements = {}
128+ latex_elements = {
129+ }
135130latex_documents = [
136- (
137- master_doc ,
138- "visualea.tex" ,
139- "visualea Documentation" ,
140- "INRA / INRIA / CIRAD" ,
141- "manual" ,
142- ),
131+ (master_doc , 'visualea.tex' , u'visualea Documentation' ,
132+ u'INRA / INRIA / CIRAD' , 'manual' ),
143133]
144134
145135# -- Options for manual page output ---------------------------------------
146136# One entry per manual page. List of tuples
147137# (source start file, name, description, authors, manual section).
148- man_pages = [(master_doc , "openalea.visualea" , "visualea Documentation" , [author ], 1 )]
138+ man_pages = [
139+ (master_doc , project , project + ' Documentation' ,
140+ [author ], 1 )
141+ ]
149142
150143# -- Options for Texinfo output -------------------------------------------
151144# Grouping the document tree into Texinfo files. List of tuples
152145# (source start file, target name, title, author,
153146# dir menu entry, description, category)
154147texinfo_documents = [
155- (
156- master_doc ,
157- "visualea" ,
158- "visualea Documentation" ,
159- author ,
160- "visualea" ,
161- "this is an example" ,
162- "Miscellaneous" ,
163- ),
148+ (master_doc , project , project + ' Documentation' ,
149+ author , project , desc ,
150+ 'Miscellaneous' ),
164151]
165152# Example configuration for intersphinx: refer to the Python standard library.
166- intersphinx_mapping = {" python" : (" https://docs.python.org/" , None )}
153+ intersphinx_mapping = {' python' : (' https://docs.python.org/' , None )}
0 commit comments