Publish code

In addition to the documentation in the docs/ directory, I would like to “publish” all Julia files in my Julia package to a PDF. Is there any common / preferred way to publish Julia code with syntax highlighting? I’m looking for something like Weave, but without actually running the code.

If you are willing to roll your own solution, LaTeX with the Minted package works quite well.

2 Likes

The easiest solution meeting that requirement is just using Weave with the option eval=false set globally, see:

http://weavejl.mpastell.com/stable/chunk_options/#Default-Chunk-Options

1 Like

Some text editors/IDEs have ability to print with syntax highlighting. Can use that + print to PDF.
Only one I know off the top of my head is Notepad++, but I would not be surprised if it was a really common feature.

2 Likes

Maybe this can help, that with a simple script would do the trick:

https://github.com/m3g/jlcode_example

1 Like

gedit prints with syntax highlighting too. There are also extensions for that in VS Code (VS Code Printing Free, PrintCode, and maybe more).

1 Like