Skip to content

Commit

Permalink
⬆️ Upgrade documentation dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-rozet committed Jul 19, 2024
1 parent 3e88c8e commit f9b25c0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
11 changes: 7 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import importlib
import inspect
import lampe
import pathlib
import re
import subprocess

Expand All @@ -12,9 +13,10 @@
package = 'lampe'
project = 'LAMPE'
version = lampe.__version__
copyright = '2021-2023'
copyright = '2021-2024'
repository = 'https://github.com/probabilists/lampe'
commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip()
root = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], text=True).strip()

## Extensions

Expand Down Expand Up @@ -44,7 +46,7 @@
'numpy': ('https://numpy.org/doc/stable', None),
'python': ('https://docs.python.org/3', None),
'torch': ('https://pytorch.org/docs/stable', None),
'zuko': ('https://zuko.readthedocs.io/en/stable', None),
'zuko': ('https://zuko.readthedocs.io/stable', None),
}


Expand All @@ -59,12 +61,12 @@ def linkcode_resolve(domain: str, info: dict) -> str:
for name in fullname.split('.'):
objct = getattr(objct, name)

if hasattr(objct, '__wrapped__'):
while hasattr(objct, '__wrapped__'):
objct = objct.__wrapped__

try:
file = inspect.getsourcefile(objct)
file = file[file.rindex(package) :]
file = pathlib.Path(file).relative_to(root)

lines, start = inspect.getsourcelines(objct)
end = start + len(lines) - 1
Expand Down Expand Up @@ -116,6 +118,7 @@ def linkcode_resolve(domain: str, info: dict) -> str:
},
'dark_logo': 'logo_dark.svg',
'sidebar_hide_name': True,
'top_of_page_buttons': ['view'],
}
html_title = f'{project} {version}'
pygments_style = 'sphinx'
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docutils==0.19
furo==2023.3.27
furo==2024.5.6
myst-nb==1.0.0
sphinx==6.1.3
sphinx==7.3.7
20 changes: 10 additions & 10 deletions docs/templates/autosummary/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@

nothing

{% block functions %}
{% if functions %}
Functions
---------
{% block classes %}
{% if classes %}
Classes
-------
.. autosummary::
:nosignatures:
{% for item in functions %}
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
Classes
-------
{% block functions %}
{% if functions %}
Functions
---------
.. autosummary::
:nosignatures:
{% for item in classes %}
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
Expand Down

0 comments on commit f9b25c0

Please sign in to comment.