Skip to content

Instantly share code, notes, and snippets.

@dirceu
Created January 23, 2021 01:46
Show Gist options
  • Save dirceu/2f70e0618b01fa70308b548817dd0cf6 to your computer and use it in GitHub Desktop.
Save dirceu/2f70e0618b01fa70308b548817dd0cf6 to your computer and use it in GitHub Desktop.
Dir['*.md'].each do |filename|
content = File.open(filename).read
#if ["-", ""].include?(content.strip)
# File.delete(filename)
# next
#end
File.open(filename, 'w') do |f|
f.write("# #{filename.gsub('.md', '')}\n\n")
f.write(content)
end
end
# https://github.com/andymatuschak/note-link-janitor
`note-link-janitor .`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment