Skip to content

Commit

Permalink
update-docs: accommodate for changes in Git v2.48.0
Browse files Browse the repository at this point in the history
As of Git's 9219325be74 (Documentation: allow sourcing generated
includes from separate dir, 2024-12-06), there are no regular
`include::<path>` statements left that were expected by the
`update-docs.rb` script, but they are now `include::{build_dir}/<path>`
instead.

Let's accommodate for that.

This fixes git#1941

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Jan 22, 2025
1 parent 6843a48 commit d51c252
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script/update-docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def wrap_front_matter(front_matter)
end

def expand_l10n(path, content, get_f_content, categories)
content.gsub!(/include::(\S+)\.txt/) do |line|
content.gsub!(/include::({build_dir}\/)?(\S+)\.txt/) do |line|
line.gsub!("include::", "")
if categories[line]
new_content = categories[line]
Expand Down Expand Up @@ -240,7 +240,7 @@ def drop_uninteresting_tags(tags)
end

def expand_content(content, path, get_f_content, generated)
content.gsub(/include::(\S+)\.txt\[\]/) do |_line|
content.gsub(/include::(?:{build_dir}\/)?(\S+)\.txt\[\]/) do |_line|
if File.dirname(path) == "."
new_fname = "#{$1}.txt"
else
Expand Down

0 comments on commit d51c252

Please sign in to comment.