Skip to content

Instantly share code, notes, and snippets.

@coffeebite
Created October 22, 2011 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coffeebite/1306615 to your computer and use it in GitHub Desktop.
Save coffeebite/1306615 to your computer and use it in GitHub Desktop.
Clear source from yard documentation
require "find"
Find.find(".") do |file|
if file.match(/\.html$/)
puts "Filtering #{file}"
content = File.read(file)
no_source_content = content.gsub(/<table class="source_code".*?<\/table>/m, "")
File.open(file, "w") { |io| io.write no_source_content }
end
end
unless File.read("css/common.css").match(/Hide source links/)
File.open("css/common.css", "a+") { |io| io.write("\n/* Hide source links */\n.toggleSource { display:none }") }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment