-
-
Save juanbono/5f09876c3393ca801fce69e4a9db7c3b to your computer and use it in GitHub Desktop.
Erlang literate programming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 - | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment