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

Return stable version tag with stable version API/context data #4000

Open
agjohnson opened this issue Apr 23, 2018 · 5 comments
Open

Return stable version tag with stable version API/context data #4000

agjohnson opened this issue Apr 23, 2018 · 5 comments
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required
Milestone

Comments

@agjohnson
Copy link
Contributor

I found myself wanting this information in our documentation portal. I'd rather display the tag that stable points to, rather than stable. There are a few places where we could display this information differently:

  • On the docs flyout menu (so return this information from the footer API)
  • Inside the sphinx config (so return this information alongside the context data)
  • In the API directly

I don't believe we are currently tracking this, we're just tracking the changeset of the tag.

Alternatively, we could potentially make version rules as an alternative feature to stable version. I'll discuss this in a separate ticket.

@agjohnson agjohnson added Improvement Minor improvement to code Needed: design decision A core team decision is required labels Apr 23, 2018
@agjohnson agjohnson added this to the Admin UX milestone Apr 23, 2018
@agjohnson
Copy link
Contributor Author

See #4001 for discussion on automated rules for versioning.

@humitos
Copy link
Member

humitos commented Nov 15, 2018

This is related to #4529 that talks about showing the tag that stable points to in below the project's title.

@stsewd
Copy link
Member

stsewd commented Mar 27, 2019

Here is my comment, we can change this in the theme and in the API response. We have the information available.

#4529 (comment)

@Jackenmen
Copy link

It seems that this information is available through API v3 under stable's aliases key but the problem is that this API requires authentication and I don't think there is any way to actually use it from a build. The deprecated API v2 tat doesn't require auth does not provide the same information. So basically I thought I have found a workaround but it doesn't actually work because I can't auth 😄

I wanted to get the information about the stable tag so that I can show the old version warning. I don't want to use the new Addons for it (I like the old warning formatting in sphinx-rtd-theme style to be nicer) but it seems that I lack the necessary metadata to do so.

@humitos
Copy link
Member

humitos commented Jul 17, 2024

but the problem is that this API requires authentication and I don't think there is any way to actually use it from a build.

We are having some conversations about removing the auth requirement from APIv3, but we haven't made the changes yet. Eventually, that would be the way to get this data at build time.

I wanted to get the information about the stable tag so that I can show the old version warning. I don't want to use the new Addons for it (I like the old warning formatting in sphinx-rtd-theme style to be nicer) but it seems that I lack the necessary metadata to do so.

You can use the JavaScript event readthedocs-addons-data-ready which is the new way to make custom integrations like this one. You can see an example of how our theme integrates the flyout as example using this data at readthedocs/sphinx_rtd_theme#1526

We plan to document this JavaScript event soon, so people can start building their own integrations. In the meanwhile, please open a new issue if you feel you need some help with it and we can talk over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

4 participants