I like to read source code on my Kindle, and thus I need to convert it to either epub or HTML.

I want the result to preferably have syntax highlighting and auto detection of source language. If not, even a tool to convert plain text to EPUB is enough.

Other requirements: CLI-based, unix

The best solution I have found thus far:

pandoc -s -f markdown <(ec '```python') *.py <(ec '```') -o a.epub

  • 1
    Have a look at doxygen, here you get the documentation and also the possibility to display the source code. Only thing is that you didn't specify your source language, so not sure if the source language is supported. – albert Aug 15 '19 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.