This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# Inserts the file's name as the first header in the file, if it isn't already there. | |
# Original file saved as filename.bak. | |
# | |
# As always, caveat emptor. This code could harm your files, so try it on a backup. | |
# | |
Dir.glob('*.md') do |filename| | |
puts "working on: #{filename}" | |
id_text = nil |