|
1 |
| -import os,sys |
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +import sys |
| 3 | +import os |
2 | 4 |
|
3 |
| -# read sphinx conf.py file |
4 |
| -from openalea.misc.sphinx_configuration import * |
5 |
| -from openalea.misc.sphinx_tools import sphinx_check_version |
6 |
| -from openalea.deploy.metainfo import read_metainfo |
| 5 | +import pydata_sphinx_theme # Pydata theme: https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html |
7 | 6 |
|
8 |
| -sphinx_check_version() # check that sphinx version is recent |
9 |
| -metadata = read_metainfo('../metainfo.ini') # read metainfo from common file with setup.py |
10 |
| -for key in ['version','project','release', 'name']: |
11 |
| - exec("%s = '%s'" % (key, metadata[key])) |
12 | 7 |
|
13 |
| -# by product that need to be updated: |
14 |
| -latex_documents = [('contents', 'main.tex', project + ' documentation', authors, 'manual')] |
| 8 | +# Get the project root dir, which is the parent dir of this |
| 9 | +cwd = os.getcwd() |
| 10 | +project_root = os.path.dirname(cwd) |
15 | 11 |
|
16 |
| -project = name |
| 12 | +# Insert the project root dir as the first element in the PYTHONPATH. |
| 13 | +# This lets us ensure that the source package is imported, and that its |
| 14 | +# version is used. |
| 15 | +sys.path.insert(0, os.path.join(project_root, 'src')) |
| 16 | + |
| 17 | +# -- General configuration ------------------------------------------------ |
| 18 | +# Add any Sphinx extension module names here, as strings. They can be |
| 19 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 20 | +# ones. |
| 21 | +extensions = [ |
| 22 | + 'sphinx.ext.autodoc', # support for automatic inclusion of docstring |
| 23 | + 'sphinx.ext.autosummary', # generates autodoc summaries |
| 24 | + 'sphinx.ext.doctest', # inclusion and testing of doctest code snippets |
| 25 | + 'sphinx.ext.intersphinx', # support for linking to other projects |
| 26 | + 'sphinx.ext.mathjax', # support for math equations |
| 27 | + 'sphinx.ext.ifconfig', # support for conditional content |
| 28 | + 'sphinx.ext.viewcode', # support for links to source code |
| 29 | + 'sphinx.ext.coverage', # includes doc coverage stats in the documentation |
| 30 | + 'sphinx.ext.todo', # support for todo items |
| 31 | + 'sphinx.ext.napoleon', # support for numpy and google style docstrings |
| 32 | + "sphinx_favicon", # support for favicon |
| 33 | + "nbsphinx", # for integrating jupyter notebooks |
| 34 | + "myst_parser" # for parsing .md files |
| 35 | +] |
| 36 | +# Add any paths that contain templates here, relative to this directory. |
| 37 | +templates_path = ['_templates'] |
| 38 | +autosummary_generate = True |
| 39 | +exclude_patterns = ['_build', '_templates'] |
| 40 | +# The suffix(es) of source filenames. |
| 41 | +# You can specify multiple suffix as a list of string: |
| 42 | +source_suffix = { |
| 43 | + '.rst': 'restructuredtext', |
| 44 | + '.md': 'markdown', |
| 45 | +} |
| 46 | +# The master toctree document. |
| 47 | +master_doc = 'index' |
| 48 | +# General information about the project. |
| 49 | +project = u'rsml' |
| 50 | +copyright = u'Cecill-C INRAE / INRIA / CIRAD' |
| 51 | +author = u'Christophe Pradal' |
| 52 | + |
| 53 | +# The version info for the project you're documenting, acts as replacement for |
| 54 | +# |version| and |release|, also used in various other places throughout the |
| 55 | +# built documents. |
| 56 | +# |
| 57 | +pkgver={} |
| 58 | +with open("../src/rsml/version.py") as fp: |
| 59 | + exec(fp.read(), pkgver) |
| 60 | +# The short X.Y version. |
| 61 | +version = str(pkgver["MAJOR"])+'.'+str(pkgver["MINOR"]) |
| 62 | +# The full version, including alpha/beta/rc tags. |
| 63 | +release = pkgver["__version__"] |
| 64 | + |
| 65 | +# The language for content autogenerated by Sphinx. Refer to documentation |
| 66 | +# for a list of supported languages. |
| 67 | +# |
| 68 | +# This is also used if you do content translation via gettext catalogs. |
| 69 | +# Usually you set "language" from the command line for these cases. |
| 70 | +language = "en" |
| 71 | +# The name of the Pygments (syntax highlighting) style to use. |
| 72 | +pygments_style = 'sphinx' |
| 73 | +# If true, `todo` and `todoList` produce output, else they produce nothing. |
| 74 | +todo_include_todos = False |
| 75 | + |
| 76 | +# -- Options for HTML output ---------------------------------------------- |
| 77 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 78 | +# a list of builtin themes. |
| 79 | +html_theme = 'pydata_sphinx_theme' |
| 80 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 81 | +# further. For a list of options available for each theme, see the |
| 82 | +# documentation. |
| 83 | +html_theme_options = { |
| 84 | + "header_links_before_dropdown": 6, |
| 85 | + "sidebarwidth": 200, |
| 86 | + "sticky_navigation": "false", |
| 87 | + "collapse_navigation": "false", |
| 88 | + "display_version": "true", |
| 89 | + "icon_links": [ |
| 90 | + { |
| 91 | + "name": "GitHub", |
| 92 | + "url": "https://github.com/openalea/openalea.rtfd.io", |
| 93 | + "icon": "fa-brands fa-github", |
| 94 | + }, |
| 95 | + ], |
| 96 | + "show_version_warning_banner": True, |
| 97 | + "footer_start": ["copyright"], |
| 98 | + "footer_center": ["sphinx-version"], |
| 99 | + "secondary_sidebar_items": { |
| 100 | + "**/*": ["page-toc", "edit-this-page", "sourcelink"], |
| 101 | + "examples/no-sidebar": [], |
| 102 | + }, |
| 103 | + } |
| 104 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 105 | +# relative to this directory. They are copied after the builtin static files, |
| 106 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 107 | +html_static_path = ['_static'] |
| 108 | +html_logo = "_static/openalea_web.svg" |
| 109 | +html_favicon = "_static/openalea_web.svg" |
| 110 | +# If false, no module index is generated. |
| 111 | +html_domain_indices = True |
| 112 | +# If false, no index is generated. |
| 113 | +html_use_index = True |
| 114 | +# If true, the index is split into individual pages for each letter. |
| 115 | +html_split_index = False |
| 116 | +# If true, links to the reST sources are added to the pages. |
| 117 | +html_show_sourcelink = True |
| 118 | +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
| 119 | +html_show_sphinx = True |
| 120 | +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
| 121 | +html_show_copyright = True |
| 122 | +# Output file base name for HTML help builder. |
| 123 | +htmlhelp_basename = 'rsml_documentation' |
| 124 | + |
| 125 | +# -- Options for LaTeX output --------------------------------------------- |
| 126 | +latex_elements = { |
| 127 | +} |
| 128 | +latex_documents = [ |
| 129 | + (master_doc, 'rsml.tex', u'rsml Documentation', |
| 130 | + u'INRAE / inria / CIRAD', 'manual'), |
| 131 | +] |
| 132 | + |
| 133 | +# -- Options for manual page output --------------------------------------- |
| 134 | +# One entry per manual page. List of tuples |
| 135 | +# (source start file, name, description, authors, manual section). |
| 136 | +man_pages = [ |
| 137 | + (master_doc, 'rsml', u'rsml Documentation', |
| 138 | + [author], 1) |
| 139 | +] |
| 140 | + |
| 141 | +# -- Options for Texinfo output ------------------------------------------- |
| 142 | +# Grouping the document tree into Texinfo files. List of tuples |
| 143 | +# (source start file, target name, title, author, |
| 144 | +# dir menu entry, description, category) |
| 145 | +texinfo_documents = [ |
| 146 | + (master_doc, 'rsml', u'rsml Documentation', |
| 147 | + author, 'rsml', 'RootSystemML (RSML) is a file format to represent root architectural data.', |
| 148 | + 'Miscellaneous'), |
| 149 | +] |
| 150 | +# Example configuration for intersphinx: refer to the Python standard library. |
| 151 | +intersphinx_mapping = {'python': ('https://docs.python.org/', None)} |
0 commit comments