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

Update conf.py to retrieve version numbers for various libraries, so they can be referred to dynamically in various docs #7447

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
31 changes: 31 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,37 @@ def update_versions(app, docname, source):
"{{VIZZU_VERSION}}" : VIZZU_VERSION,
}

def update_versions(app, docname, source):
Coderambling marked this conversation as resolved.
Show resolved Hide resolved
from panel.models.deckgl import DECKGL_VERSION
from panel.models.echarts import ECHARTS_VERSION
from panel.models.katex import KATEX_VERSION
from panel.models.mathjax import MATHJAX_VERSION
from panel.models.plotly import PLOTLY_VERSION
from panel.models.pydeck import PYDECK_VERSION
from panel.models.pyecharts import PYECHARTS_VERSION
from panel.models.tabulator import TABULATOR_VERSION
from panel.models.vega import VEGA_VERSION
from panel.models.vizzu import VIZZU_VERSION

# Inspired by: https://stackoverflow.com/questions/8821511
version_replace = {
"{{PANEL_VERSION}}": PY_VERSION,
"{{BOKEH_VERSION}}": BOKEH_VERSION,
"{{PYSCRIPT_VERSION}}": PYSCRIPT_VERSION,
"{{PYODIDE_VERSION}}": _get_pyodide_version(),
"{{ALTAIR_VERSION}}": ALTAIR_VERSION,
"{{DECKGL_VERSION}}": DECKGL_VERSION,
"{{ECHARTS_VERSION}}": ECHARTS_VERSION,
"{{KATEX_VERSION}}": KATEX_VERSION,
"{{MATHJAX_VERSION}}": MATHJAX_VERSION,
"{{PLOTLY_VERSION}}": PLOTLY_VERSION,
"{{PYDECK_VERSION}}": PYDECK_VERSION,
"{{PYECHARTS_VERSION}}": PYECHARTS_VERSION,
"{{TABULATOR_VERSION}}": TABULATOR_VERSION,
"{{VEGA_VERSION}}": VEGA_VERSION,
"{{VIZZU_VERSION}}": VIZZU_VERSION,
}

for old, new in version_replace.items():
source[0] = source[0].replace(old, new)

Expand Down