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

https://nix.dev "Suggest an edit" button leads to 404 page #12340

Open
1 of 2 tasks
onnimonni opened this issue Jan 23, 2025 · 5 comments
Open
1 of 2 tasks

https://nix.dev "Suggest an edit" button leads to 404 page #12340

onnimonni opened this issue Jan 23, 2025 · 5 comments
Labels

Comments

@onnimonni
Copy link
Contributor

onnimonni commented Jan 23, 2025

Describe the bug

Trying to edit nix docs directly in https://nix.dev leads to 404 page.

Steps To Reproduce

  1. Visit any page in nix.dev docs eg: https://nix.dev/manual/nix/2.21/installation/uninstall

  2. Try to click the "Suggest an edit" button

  3. You will see 404 page from Github.

Image

Expected behavior

I should be linked directly to the edit page in Github.

Additional context

It seems that the link takes me to:
https://github.com/NixOS/nix/tree/master/doc/manual/src/installation/uninstall.md

Instead it should take me to this page so replacing ../src/.. -> ../source/..:
https://github.com/NixOS/nix/tree/master/doc/manual/source/installation/uninstall.md

Checklist


Add 👍 to issues you find important.

@onnimonni onnimonni added the bug label Jan 23, 2025
@onnimonni onnimonni changed the title https://nix.dev edit links lead to 404 https://nix.dev "Suggest an edit" button leads to 404 page Jan 23, 2025
@edolstra
Copy link
Member

Yeah that file no longer exists on master.

I don't think there is much we can do about this. We could link to the correct maintenance branch on GitHub, but generally we want people to make edits to master (and then backport them if appropriate).

@allrealmsoflife
Copy link
Contributor

When you say "I don't think there is much we can do about this," could you clarify what you mean? I've been investigating how the "Suggest an edit" button works, but I can't find any reference to it in the nix.dev repository or how it generates the links. When inspecting it I see it's a git-edit-button. Is there a way to redirect it to point to the correct source/ path, or is this limitation due to something else?

@allrealmsoflife
Copy link
Contributor

  • I'm looking at the conf.py file in the nix-dev source and the path_to_docs field is already set to source.
html_theme_options = {
    "repository_url": "https://github.com/nixos/nix.dev",
    "repository_branch": "master",
    "path_to_docs": "source",
    "use_repository_button": True,
    "use_issues_button": True,
    "use_edit_page_button": True,
    "show_navbar_depth": 2,
}

@onnimonni What do you mean any page in nix.dev docs? I only see nix manuals affected by this suggest an edit error. I can edit other pages such as https://github.com/nixos/nix.dev/edit/master/source/tutorials/cross-compilation.md but the manuals though seem to be redirecting differently. I

@fricklerhandwerk
Copy link
Contributor

The edit button for the Nix manual is rendered by mdBook (which is correctly flagged as broken here) while the rest of nix.dev is rendered by Sphinx (that works).

There are multiple underlying problems:

  • mdBook to my knowledge doesn't have a way to map to sources which aren't dumb files, but we actually generate many pages from code or otherwise slap them together from various bits and pieces.

  • As Eelco noted, files may move around between revisions. I agree we'd want people to work on master, and for that we'd have to point them there reliably and that seems to be very involved.

    There may be a creative workaround, such as (in the nix.dev multi-version presentation) highlighting that one is not viewing master and showing how to do that. Or letting people do PRs against release branches if we can afford the maintenance-effort wise. In any case the first problem persists and will be in the way.

  • The mdBook config needs to know which release it's built from to link the right general direction, knowledge which may or may not be a good idea to maintain inside the repo itself.

So it's complicated. To really fix this it would require a bunch of outside-the-box thinking. And then what do you do with precious releases...

@onnimonni
Copy link
Contributor Author

onnimonni commented Jan 24, 2025

@onnimonni What do you mean any page in nix.dev docs?

You are right that when I said "isit any page in nix.dev" I was wrong and this only affects older versions.

When I read the page: https://nix.dev/manual/nix/2.21/installation/uninstall it wasn't really obvious to me that it wasn't the latest version.

Having a red banner like python docs have for older versions might be a good idea: https://docs.python.org/3.7/tutorial/index.html

Then I would have probably figured out to go to the newest docs and there the link would have worked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants