-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix the automatic generation of anchors in the reference doc #2012
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
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 <[email protected]>
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,
<!-- ... --> |
Thanks @jnavila ! |
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.
Looks good to me.
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.
Whoops. Too late.
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>" |
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.
Couldn't we simply have done a s/href/id/
instead?
What about git-scm.com/script/update-docs.rb Line 191 in f240847
|
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.