Print Source Code

Dec 16, 2013
1 min read
May 30, 2023 14:12 EEST

To have a nice output the following command can be used to generate a nice files.pdf with the complete project print in highlighted colors:

find . -name '*.js' -or -name '*.json' -or -name '*.html'\
|xargs enscript -r -2 --file-align=1 --highlight --color --line-numbers -o - |ps2pdf - files.pdf
-r print landscape
-2 two pages by side
--file-align=1 every file on one page
--highlight and --color highlight the code with color
--line-numbers include line numbers
-o - print the output to stdout

Related Posts