mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
ensure authors get warnings about broken links, and ensure end users don't
This commit is contained in:
parent
dab7813ebc
commit
1ff3ae3ed7
2 changed files with 2 additions and 1 deletions
|
@ -247,6 +247,7 @@ end
|
||||||
|
|
||||||
desc 'Generate guides (for authors), use ONLY=foo to process just "foo.textile"'
|
desc 'Generate guides (for authors), use ONLY=foo to process just "foo.textile"'
|
||||||
task :guides do
|
task :guides do
|
||||||
|
ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this
|
||||||
ruby "guides/rails_guides.rb"
|
ruby "guides/rails_guides.rb"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ module RailsGuides
|
||||||
guess = anchors.min { |a, b|
|
guess = anchors.min { |a, b|
|
||||||
Levenshtein.distance(fragment_identifier, a) <=> Levenshtein.distance(fragment_identifier, b)
|
Levenshtein.distance(fragment_identifier, a) <=> Levenshtein.distance(fragment_identifier, b)
|
||||||
}
|
}
|
||||||
puts "*** BROKEN LINK: ##{fragment_identifier}, perhaps you meant ##{guess}."
|
puts "*** BROKEN LINK: ##{fragment_identifier}, perhaps you meant ##{guess}." if ENV.key?("WARN_BROKEN_LINKS")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue