Skip to content

Instantly share code, notes, and snippets.

@trauber
Last active January 28, 2023 02:04
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save trauber/4955706 to your computer and use it in GitHub Desktop.
Save trauber/4955706 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