Skip to content

Instantly share code, notes, and snippets.

@ywindish
Last active April 28, 2016 14:25
Show Gist options
  • Save ywindish/4950838 to your computer and use it in GitHub Desktop.
Save ywindish/4950838 to your computer and use it in GitHub Desktop.
perl one-liner: Markdown text to HTML
# one-liner
# Markdown document to HTML from Text::Markdown
#
# perl -MText::Markdown=markdown -e "$txt='';while(<>){$txt.=$_};print markdown($txt);" < test.txt
#
@ywindish
Copy link
Author

もっとうまいやり方があるはず

@UltraNurd
Copy link

I had to switch quotes to avoid bash variable expansion:

'$txt="";while(<>){$txt.=$_};print markdown($txt);'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment