Skip to content

Instantly share code, notes, and snippets.

@lukego
Created October 25, 2012 11:46
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lukego/3952159 to your computer and use it in GitHub Desktop.
Save lukego/3952159 to your computer and use it in GitHub Desktop.
Erlang literate programming
Simple literate programming.
Add comments to your Erlang file with a special %%% syntax, like this:
%%% This is a comment that will be formatted in a variable width font with Markdown.
%%% You can use *emphasis* and
%%% # Headings
%%% and even
%%%
%%% - Lists
%%% - of
%%% - things
%%%
%%% while the rest of the code is formatted like normal.
Then format the file by using sed to convert to Markdown and pandoc to convert to PDF:
sed -E -e 's/^/ /g' -e 's/^ %%% ?//g' | pandoc --toc -o listing.pdf -
@etnt
Copy link

etnt commented Oct 25, 2012

where is the 'like button' ???

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