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

Let theme authors decide the version of the data supported #61

Closed
humitos opened this issue Apr 24, 2023 · 1 comment · Fixed by #64
Closed

Let theme authors decide the version of the data supported #61

humitos opened this issue Apr 24, 2023 · 1 comment · Fixed by #64

Comments

@humitos
Copy link
Member

humitos commented Apr 24, 2023

Add a <meta name="readthedocs" content="version: 1.0" />

This will let the client how to expose the window.readthedocs object. The client may need to do an extra call to the API to get the data in the structure the theme is expecting.

See #60 which is the one that will use this to keep compatibility.

@humitos
Copy link
Member Author

humitos commented Apr 24, 2023

If there is not meta tag in the HTML, we don't expose the window.readthedocs object and we don't trigger any of the custom events.

This way, we force the user of our structure to clearly communicate the version they support.

@humitos humitos changed the title Let the theme decide the version of the data supported Let theme authors decide the version of the data supported Apr 24, 2023
humitos added a commit that referenced this issue Apr 27, 2023
Let users to define `<meta name="readthedocs-api-version" content="1.0">` to
tell Read the Docs client what is the API scheme version supported by them.

When our client request the API data, if the `api_version` returned does not
match with the one expected by the user, another request is done to force a
particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event and expose
`window.readthedocs`, to let our users know this data is ready to be consumed by
their own integrations.

Closes #60
Closes #61
humitos added a commit that referenced this issue Apr 27, 2023
Let users to define `<meta name="readthedocs-api-version" content="1.0">` to
tell Read the Docs client what is the API scheme version supported by them.

When our client request the API data, if the `api_version` returned does not
match with the one expected by the user, another request is done to force a
particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event and expose
`window.readthedocs`, to let our users know this data is ready to be consumed by
their own integrations.

Closes #60
Closes #61
humitos added a commit that referenced this issue Apr 27, 2023
Let users to define `<meta name="readthedocs-api-version" content="1.0">` to
tell Read the Docs client what is the API scheme version supported by them.

When our client request the API data, if the `api_version` returned does not
match with the one expected by the user, another request is done to force a
particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event,
to let our users know this data is ready to be consumed by their own
integrations.

Closes #60
Closes #61
humitos added a commit that referenced this issue Apr 15, 2024
…Event` (#64)

Let users to define `<meta name="readthedocs-api-version"
content="1.0">` to tell Read the Docs client what is the API scheme
version supported by them.

When our client request the API data, if the `api_version` returned does
not match with the one expected by the user, another request is done to
force a particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event ~~and expose
`window.readthedocs`~~, to let our users know this data is ready to be
consumed by their own integrations.

Closes #60
Closes #61
Closes #17 
Closes readthedocs/readthedocs.org#9957
Closes #250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant