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

Flyout: can't be injected into custom HTML element #276

Closed
mowies opened this issue Mar 13, 2024 · 4 comments
Closed

Flyout: can't be injected into custom HTML element #276

mowies opened this issue Mar 13, 2024 · 4 comments
Assignees
Labels
Feature New feature

Comments

@mowies
Copy link

mowies commented Mar 13, 2024

Since the beta was enable for the keptn project, the flyout menu is not injected into our designated place anymore.
I looked at the addon code for the new flyout menu already and didn't find anything about injection into custom places.
It would be great to have that feature!

@humitos
Copy link
Member

humitos commented Mar 13, 2024

Hi @mowies. Currently, the flyout only has that position. However, we have been working on a way to let users customize the whole rendering of it by subscribing to a JavaScript CustomEvent that contains all the data in JSON that Read the Docs exposes.

Note we don't plan to perform this integration on each of the theme, but expose the data and JS event so users can subscribe to it and render the flyout as they want.

I would appreciate any feedback you may provide on this approach, since it's still under development.

@humitos humitos changed the title Flyout menu can't be injected into custom HTML element Flyout: can't be injected into custom HTML element Mar 13, 2024
@humitos humitos added the Feature New feature label Mar 13, 2024
@mowies
Copy link
Author

mowies commented Mar 13, 2024

Cool that it's being worked on!
Although I think the injection solution is much more elegant since no additional custom JS is needed to actually render it.
On the other hand, that means that theme developers don't need to follow whatever the flyout menu HTML uses in terms of classes etc. for styling.

@humitos humitos self-assigned this Apr 9, 2024
@humitos
Copy link
Member

humitos commented Apr 22, 2024

@mowies the PR #64 was already merged and deployed. You should be able to subscribe to readthedocs-addons-data-ready event and use event.detail.data() to get the Read the Docs data exposed and generate version/language selectors where you wish. Unfortunately, we don't have documentation written about this yet, but here you have 2 examples for this integration:

Let me know if this is helpful for you and/or if you have any doubt about how to integrate this selectors into your project.

@humitos
Copy link
Member

humitos commented Apr 25, 2024

By the way, the Material for MkDocs integration can be seen live at https://test-builds.readthedocs.io/en/mkdocs-material/ and the CPython's one can be seen live at https://cpython-previews.readthedocs.io/en/main/.

I will close this issue since there is any action from our side, but I'm happy to receive any feedback you may have here. Also, feel free to open another issue if you have any doubt or something is not working as expected.

@humitos humitos closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature
Projects
Archived in project
Development

No branches or pull requests

2 participants