Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Created March 31, 2012 18:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttscoff/2267373 to your computer and use it in GitHub Desktop.
Save ttscoff/2267373 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
=begin
Uses MultiMarkdown (must be installed at /usr/local/bin/multimarkdown) to render input,
then converts `{{text}}` to `<u>text</u>`, providing underlines in the HTML output.
=end
input=STDIN.read
def e_sh(str)
str.to_s.gsub(/(?=["\\])/, '\\')
end
puts %x{echo "#{e_sh input}"|/usr/local/bin/multimarkdown}.gsub(/\{\{/,"<u>").gsub(/\}\}/,"</u>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment