For the ebook, install pandoc, then run this:
pandoc -f rst -t epub2 -o pkgsample.epub --metadata title=“nedbat/pkgsample: A simple example of how to structure a Python project” --metadata author=“Ned Batchelder” https://github.com/nedbat/pkgsample/raw/main/README.rst
In case you’re on Archlinux, the thonny 4.1.4-1 package in chaotic-aur unofficial repo works for me.