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

Add READTHEDOCS_DATA for default version URL #9532

Closed
agjohnson opened this issue Aug 22, 2022 · 3 comments
Closed

Add READTHEDOCS_DATA for default version URL #9532

agjohnson opened this issue Aug 22, 2022 · 3 comments
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required

Comments

@agjohnson
Copy link
Contributor

agjohnson commented Aug 22, 2022

Raised in readthedocs/doc-diff#3, it would be helpful to add a value for the base URL that the diff library will use to compare pages. My current approach is hacky and full of holes.

I'm not certain, but I think what I'm looking for is at least the hostname of the default version, though with changes around subproject URL structure/etc, I guess this might need to be the hostname and base path to the project (https://docs.readthedocs.io/projects/foo/en/latest/).

Ultimately, this needs to be the full URL and path to the page to compare (https://docs.readthedocs.io/en/latest/some/path/page.html). I'm currently grabbing the page name from the READTHEDOCS_DATA page attribute, which might not be ideal. Currently I just append .html to the URL, and this likely doesn't work for all projects.

So, this might be a resolved base URL, or fully resolved base URL and file path name. Either probably work for the diff library use case.

I'm guessing this would be implemented in readthedocs-sphinx-ext, but I'm also assuming we'll want to use our resolver for this value.

@agjohnson agjohnson added Improvement Minor improvement to code Needed: design decision A core team decision is required labels Aug 22, 2022
@agjohnson agjohnson moved this to Planned in 📍Roadmap Aug 22, 2022
@ericholscher
Copy link
Member

You might be able to use this? https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/api/v2/views/core_views.py#L23-L27

@agjohnson
Copy link
Contributor Author

Ah yes, that might be enough!

@humitos
Copy link
Member

humitos commented May 23, 2023

We are removing the usage of READTHEDOCS_DATA and migrating all of it to the new API endpoint, /readthedocs-config/ which will be used by the new js client. Developers can subscribe to a js event to access this data as well: readthedocs/addons#60

Related to readthedocs/addons#23 also; where we are building the docdiff integration.

@humitos humitos closed this as completed May 23, 2023
@github-project-automation github-project-automation bot moved this from Planned to Done in 📍Roadmap May 23, 2023
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
Archived in project
Development

No branches or pull requests

3 participants