Permalink
Browse files

ensure authors get warnings about broken links, and ensure end users …

…don't
  • Loading branch information...
1 parent dab7813 commit 1ff3ae3ed7eb04268ffc880d1c39ad7957a9a7f7 @fxn fxn committed Mar 22, 2009
Showing with 2 additions and 1 deletion.
  1. +1 −0 railties/Rakefile
  2. +1 −1 railties/guides/rails_guides/generator.rb
View
@@ -247,6 +247,7 @@ end
desc 'Generate guides (for authors), use ONLY=foo to process just "foo.textile"'
task :guides do
+ ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this
ruby "guides/rails_guides.rb"
end
@@ -164,7 +164,7 @@ def check_fragment_identifiers(html, anchors)
guess = anchors.min { |a, 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

0 comments on commit 1ff3ae3

Please sign in to comment.