Skip to content

Instantly share code, notes, and snippets.

@satour
Created November 27, 2018 05:31
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 satour/2eb1eb7543825b8b36abf3b1d328d3e5 to your computer and use it in GitHub Desktop.
Save satour/2eb1eb7543825b8b36abf3b1d328d3e5 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'find'
@image = /^[!][\[]*/
i = 1
Find.find('.') {|fname|
if ( File.extname(fname) == '.md' || File.extname(fname) == '.markdown' )
File.open(fname, "r") { |original|
original.each_line {|line|
if @image.match(line.chomp)
puts "#{i}: #{line.chomp}"
i += 1
end
}
}
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment