fix the automatic generation of anchors in the reference doc#2012
Merged
fix the automatic generation of anchors in the reference doc#2012
Conversation
The automatic generation of anchors in the reference documentation by copilot in #2007 was wrong. What needs to be added is additional ids that can be used to link to the terms of definition lists. At the same time, the advertised anchor is change to reflect the new format. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Collaborator
|
Works like a charm: Snippet from the resulting <dl>
<dt class="hdlist1" id="Documentation/git-clone.txt-code-lcode"><a id="Documentation/git-clone.txt--l" class="anchor" href="#Documentation/git-clone.txt--l"></a><code>-l</code> </dt>
<dt class="hdlist1" id="Documentation/git-clone.txt-code--localcode"><a id="Documentation/git-clone.txt---local" class="anchor" href="#Documentation/git-clone.txt---local"></a><code>--local</code> </dt>
<dd>
<p>When the repository to clone from is on a local machine,
<!-- ... --> |
Collaborator
|
Thanks @jnavila ! |
dscho
reviewed
Jun 3, 2025
Comment on lines
-490
to
-493
| clean_anchor = "<a class=\"anchor\" href=\"##{clean_anchor}\"></a> " | ||
| "<dt class=\"hdlist1\" id=\"#{anchor}\"><a id=\"#{clean_anchor}\" class=\"anchor\" href=\"##{clean_anchor}\"></a>#{$1} </dt>" | ||
| else | ||
| "<dt class=\"hdlist1\" id=\"#{anchor}\"><a class=\"anchor\" href=\"##{anchor}\"></a>#{$1} </dt>" | ||
| end | ||
|
|
||
| "<dt class=\"hdlist1\" id=\"#{anchor}\"> #{clean_anchor}<a class=\"anchor\" href=\"##{anchor}\"></a>#{$1} </dt>" |
Member
There was a problem hiding this comment.
Couldn't we simply have done a s/href/id/ instead?
Member
|
What about git-scm.com/script/update-docs.rb Line 191 in f240847 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The automatic generation of anchors in the reference documentation by copilot in #2007 was wrong.
What needs to be added is additional ids that can be used to link to the terms of definition lists. At the same time, the advertised anchor is change to reflect the new format.