-
Notifications
You must be signed in to change notification settings - Fork 297
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
fix broken references #1317
fix broken references #1317
Conversation
fix internal links
fix refs
What is the difference between the anchorname and refid parameter of a node ? |
Your fix for the scrollspy breaks the internal links. It generates he format this.is.the.webpage.html#and_this_is_theAnchor .. |
The links from the search results are also broken and does not respect the underscores! |
add replaceAll(".", "_") to fix the links
search bar fixed in 6ba1624 |
@tpoint75 can you please install our pre-commit hook, run it on this PR, and push the results? There are persistent failures of our style checks, which (if using pre-commit) are detected and fixed before pushing to GitHub. |
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.
@tpoint75 sorry for the verry long wait, I think I now have time to review your PR.
- Could you rebase it on master (we had some issues with Sphinx 7 that seems to still be included to your branch)
- the searchtoold.js file that you copied is coming directly from Sphinx right ? what did you changed to make it work here ?
- how do you override the original file ?
first = parts[0] | ||
target_id = parts[1] |
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.
first = parts[0] | |
target_id = parts[1] | |
first, target_id = parts |
first = "" | ||
target_id = refid |
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.
first = "" | |
target_id = refid | |
first, target_id = "", refid |
sanitized_id = target_id.replace(".", "_") | ||
# Update the node `href` | ||
node["refuri"] = node["anchorname"] = "#" + sanitized_id | ||
node["refuri"] = first + "#" + sanitized_id |
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.
why don't you update anchorname as well ?
conditions = ( | ||
("refuri", node.get("internal", False)), | ||
("refid", True), | ||
("refuri", True), | ||
) | ||
for key, _internal in conditions: | ||
refid = node.get(key, "") | ||
if _internal and "." in refid: |
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.
whatever the value of node.get("internal", False)
the refuri key will be tested as True in l108 is it normal ? If yes why not simply use a list: ["refid", "refuri"] ?
No description provided.