Skip to content

Commit b12a5d7

Browse files
committed
docs: handle linkgit:curl[1] gracefully
It is a mistake to use a `linkgit` for a non-Git command. There were such mistakes in older Git versions, fixed in 1cca17dfff48 (Documentation: fix linkgit references, 2016-05-04). Since we want to build older Git versions' manual pages, and since it was just one, consistent mistake where a page wanted to link to the `curl` documentation, be nice and actually link there. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent bd640a1 commit b12a5d7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

script/update-docs.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,12 @@ def index_doc(filter_tags, doc_list, get_content)
351351
html = asciidoc.render
352352
html.gsub!(/linkgit:+(\S+?)\[(\d+)\]/) do |line|
353353
x = /^linkgit:+(\S+?)\[(\d+)\]/.match(line)
354-
relurl = "docs/#{x[1].gsub(/&#x2d;/, '-')}"
355-
"<a href='{{< relurl \"#{relurl}\" >}}'>#{x[1]}[#{x[2]}]</a>"
354+
if x[1] == "curl"
355+
"<a href='https://curl.se/docs/manpage.html'>curl</a>"
356+
else
357+
relurl = "docs/#{x[1].gsub(/&#x2d;/, '-')}"
358+
"<a href='{{< relurl \"#{relurl}\" >}}'>#{x[1]}[#{x[2]}]</a>"
359+
end
356360
end
357361
# HTML anchor on hdlist1 (i.e. command options)
358362
html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |_m|

0 commit comments

Comments
 (0)