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: "On GitHub" section with View and Edit buttons #10742

Closed
humitos opened this issue Sep 15, 2023 · 5 comments
Closed

Flyout: "On GitHub" section with View and Edit buttons #10742

humitos opened this issue Sep 15, 2023 · 5 comments
Labels
Feature New feature Needed: design decision A core team decision is required

Comments

@humitos
Copy link
Member

humitos commented Sep 15, 2023

The actual flyout has a section called "On GitHub" that shows two links to View and Edit the actual file on GitHub. These are just links to the exact URL for those file under github.com/.

Screenshot_2023-09-15_13-46-42

This is done via injecting some data in the build process via the readthedocs-sphinx-ext: https://github.com/rtfd/readthedocs-sphinx-ext/blob/7c60d1646c12ac0b83d61abfbdd5bcd77d324124/readthedocs_ext/_templates/readthedocs-insert.html.tmpl#L23

Keeping in mind this currently work only for Sphinx projects and that we are deprecating this extension, how we can find a reliable way to implement this feature for all the doctools and without having to inject anything in the build process? Do we have to expose this feature in the flyout? Wouldn't be better to rely on the doctool for this since it has all the data to map the source file to the final URL? Note that Read the Docs Sphinx theme already has build-it support for this https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html#file-wide-metadata

Note: this issue is opened here instead of the addons repository because the issue is about the API response. In fact, the addons already implement the VCS section of the flyout when it has the correct data.

@ericholscher
Copy link
Member

Next step here is figuring out if we even want to keep this feature, and if so what's the best way to do it.

@humitos
Copy link
Member Author

humitos commented Apr 9, 2024

Note that this is related in some way with readthedocs/actions#4 since we require a similar solution there as well.

@humitos
Copy link
Member Author

humitos commented Jun 3, 2024

Does anyone have an idea about how to do this in a reliable way and if it's worth the effort?

Honestly, I don't think we will be able to solve this in a generic way that works for most/all the documentation tools. Usually, documentation tools and themes that care about this feature, they implement it themselves and even expose a configuration setting so users can enable/disable it.

Furo Read the Docs Material for MkDocs
Screenshot_2024-06-03_17-08-41 Screenshot_2024-06-03_17-09-03 Screenshot_2024-06-03_17-09-38

With that context, it seems it's redundant to re-implement this feature inside the flyout. In particular, if we don't have a clear and easy way to implement it. At this point, I would just decide to not implement this feature in the new flyout and close this issue as not planned. What do you think?

@agjohnson
Copy link
Contributor

I'll also add that the only time I ever find myself clicking on these links in the flyout is when I want to jump to the repo on GitHub, and mostly just for debugging purposes not to view the source file.

I always want that link to just go to https://github.com/user/repo instead, which could be an option too.

@humitos
Copy link
Member Author

humitos commented Jun 5, 2024

OK. I will close this issue as not planned then.

@humitos humitos closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature Needed: design decision A core team decision is required
Projects
Archived in project
Development

No branches or pull requests

3 participants