Comment

Comment by sago

My workflow:

One time setup

    $ python -m venv ve
    $ source ve/bin/activate
    $ pip install pygments WeasyPrint
Then

    $ pygmentize -f html src.py | weasyprint - out.pdf
Both pygmentize and weasyprint have many options to play with. I find a set and create a shell script.

This also does pngs, etc:

    $ pygmentize -f html src.py | weasyprint - out.png
parent sago 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton