Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: I wrote a book on idiomatic Python. Here's its insane build/test system
15 points by jknupp on Jan 24, 2013 | hide | past | favorite | 2 comments
Background: I've been working on a book to help developers learn and write idiomatic Python. It's taken far longer than I imagined, but today I made it available for purchase (http://www.jeffknupp.com/writing-idiomatic-python-ebook).

The automated build and test system I'm using is ridiculous. It uses: virtualenv, tox, pytest, coverage, doctest, pandoc, make, xelatex, makeindex, and a ~200 line Python script to collect and format the output. The details of the build/test system I created are described in detail here: http://www.jeffknupp.com/blog/2013/01/24/the-writing-idiomatic-python-ebook-is-finally-available/

The result is two PDF files...

Does anyone who's done something similar have/know of an easier way to write a technical book (where code samples must be tested) that will eventually need to be translated into multiple formats? I know I'm not the first person to write a technical book, but I'm not aware of any existing tools (commercial or otherwise) to make the process easier. Does everyone who writes a technical book cobble together their own system?

I ask because I plan to eventually write a book where C++ is the language being discussed. The thought of going through this all again makes me shudder. After finishing this book, I'm convinced there must be a better way.

It won't help you with the translation part, but I have a small project that aims to take the next step in tested documentation after doctest: http://pypi.python.org/pypi/manuel/. Full documentation (tested with Manuel of course) at http://packages.python.org/manuel/

What about something like Sphinx? It uses ReStructured text and a Makefile to control most of the stuff.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact