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 dynamically show current release number in announcement text at top of Panel site. #6903

Merged
merged 3 commits into from
Jun 10, 2024
Merged
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
7 changes: 6 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
html_theme = "pydata_sphinx_theme"
html_favicon = "_static/icons/favicon.ico"

current_release = panel.__version__ # Current release version variable

announcement_text = f"Panel {current_release} has just been released! Check out the <a href='https://panel.holoviz.org/about/releases.html#version-1-4-0'>release notes</a> and support Panel by giving it a 🌟 on <a href='https://github.com/holoviz/panel'>Github</a>."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arf unfortunately this is not quite correct, annoucement_text contains a link to releases.html#version-1-4-0 ... @Coderambling can you please open a new PR to remove this fragment? No need to build it dynamically I think, since we always want users to see the top of the release notes page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes wel spotted, I will replace that link with the one below ok? That will show the top of the release page.

https://panel.holoviz.org/about/releases.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Copy link
Contributor Author

@Coderambling Coderambling Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, as the next PR after that, the Github API could be used to retrieve the release date, so instead the text would then be

Panel current_release was released on release_date.

Would that be an improvement?

Example code to retrieve release date from Github:

`import requests

url = "https://api.github.com/repos/holoviz/panel/releases/latest"

response = requests.get(url)
data = response.json()

print("The latest release date is:", data['published_at'])
`

It would mean importing the requests library in conf.py though. Would that be an issue?

Advantage is that it could then also be used to retrieve the number of Github Panel downloads and forks for display on the site

This would be a good way to communicate to (first time) site visitors that Panel is in active development and is a popular framework.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the hyperlink:

#7046



html_theme_options = {
"logo": {
"image_light": "_static/logo_horizontal_light_theme.png",
Expand Down Expand Up @@ -74,7 +79,7 @@
"panelitelink",
"page-toc",
],
"announcement": "Panel 1.4 has just been released! Checkout the <a href='https://panel.holoviz.org/about/releases.html#version-1-4-0'>release notes</a> and support Panel by giving it a 🌟 on <a href='https://github.com/holoviz/panel'>Github</a>.",
"announcement": announcement_text,
}

extensions += [
Expand Down