-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
nixos-render-docs-redirects: init #357383
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my initial draft which only tests the happy paths. I'll be hacking on ways to make this more robust while leaving this here to marinate.
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/69 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/splitting-the-nixpkgs-and-nixos-manuals-into-pages/55466/9 |
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should start with tests to specify what the interaction is supposed to be like, see detailed comments
pkgs/by-name/ni/nixos-render-docs-redirects/src/tests/test_redirects.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/tests/test_redirects.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs/src/nixos_render_docs/redirects.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
pkgs/by-name/ni/nixos-render-docs/src/nixos_render_docs/redirects.py
Outdated
Show resolved
Hide resolved
|
||
Moved existing content to a different output path? | ||
redirects move-content <identifier> <path> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an unspecified requirement: nrd will complain if you rename an identifier but don't also rename references. It would be very helpful if this helper tool also did something akin to
sed -i 's/<old>/<new>/g' **/*
but that needs a bit of smarts, because we have to capture old identifiers correctly (e.g. naively inserting foo
and foo2
after already having renamed the "tag" location of foo
but not the "ref" locations, will produce foo22
at the "tag").
So this is not blocking for this PR. You would get the identifier errors by nrd already, so this change doesn't make it strictly worse. It may mess with expectations though, because one may think such a command will just do the Right Thing for you already.
pkgs/by-name/ni/nixos-render-docs-redirects/src/nixos_render_docs_redirects/__init__.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2536d25
to
ae80242
Compare
Merging, let's do further improvements in follow-up PRs. |
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
A helper command to manipulate the redirects mapping to avoid having to do it manually.
As of writing, this is still a WIP, and I have mentioned a few concerns as review comments to make the discussion async.