Skip to content

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

Closed

Description

@mowies

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!

Activity

  1. humitos commented on Mar 13, 2024

    @humitos
    Member

    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.

  2. changed the title [-]Flyout menu can't be injected into custom HTML element[/-] [+]Flyout: can't be injected into custom HTML element[/+] on Mar 13, 2024
  3. mowies commented on Mar 13, 2024

    @mowies
    Author

    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.

  4. self-assigned this
    on Apr 9, 2024
  5. humitos commented on Apr 22, 2024

    @humitos
    Member

    @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.

  6. humitos commented on Apr 25, 2024

    @humitos
    Member

    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.

  7. moved this from Planned to Done in 📍Roadmapon Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions