Skip to content

Instantly share code, notes, and snippets.

@0atman
Forked from trauber/mdlp.awk
Created March 11, 2017 10:20
Show Gist options
  • Save 0atman/e8472945ff074d7dcf2f873ef81207fb to your computer and use it in GitHub Desktop.
Save 0atman/e8472945ff074d7dcf2f873ef81207fb to your computer and use it in GitHub Desktop.
Agnostic literate programming for github flavored markdown.
#!/usr/bin/awk -e { if (/^```/) { i++; next } if ( i % 2 == 1) { print } }
# mdlp - agnostic literate programming for github flavored markdown.
# I release this script into the public domain.
# Rich Traube, Fri Feb 15 09:07:27 EST 2013

mdlp

Agnostic literate programming for github flavored markdown in one line of code; provides code from markdown source. Prints to standard output. Great for a single file.

This is in the public domain.

#!/usr/bin/awk -e { if (/^```/) { i++; next } if ( i % 2 == 1) { print } }
# mdlp - agnostic literate programming for github flavored markdown.
# I release this script into the public domain.
# Rich Traube, Fri Feb 15 09:07:27 EST 2013

Fenced code is written to the program in order of occurrence.

# mdlp
Agnostic literate programming for github flavored markdown in one line of
code; provides code from markdown source. Prints to standard output.
Great for a single file.
This is in the public domain.
```awk
#!/usr/bin/awk -e { if (/^```/) { i++; next } if ( i % 2 == 1) { print } }
# mdlp - agnostic literate programming for github flavored markdown.
# I release this script into the public domain.
# Rich Traube, Fri Feb 15 09:07:27 EST 2013
-->
Fenced code is written to the program in order of occurrence.
<!--
vim:et:ai:ts=2
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment