I have an idea for a combination book and web app to help newbies learn computer programming from the ground up, and while I'm working on the web app side of it, I've been thinking in the back of my mind about the best way to do the book. Can anyone share their experiences with similar projects? Here are my requirements:
- Source must be plain text files in some markup language. (I want to be able to use version control, arbitrarly choose my editor, etc.)
- Must compile or build to produce pretty PDF output (on par with LaTeX) and HTML
- Include custom HTML/JavaScript macros in the HTML edition. For example, I want an "open this in my workspace" link on each sample code block in the HTML edition of the book but not the PDF edition. I might also want to include links to create/edit a forum thread at the bottom of each section in the HTML, including text like "There are (x) comments about this section in the Forum." (Clearly this will involve some web server-side code.)
So far it looks like my best bet is LaTeX source, pdflatex output for PDF, and some custom hacking of latex2html to produce the HTML output I want. My past experience with LaTeX tells me it's very powerful but can sometimes be klunky and awkward.
lout looks very appealing but doesn't seem to have very good built-in or third-party support for HTML.
And the last option I was thinking of would be to write the book in a non-presentation format such as Zim Desktop Wiki (my favorite outliner/note taker app) and write scripts to translate this source to HTML and to lout.
Do any of these ideas sound particularly good or particularly idiotic? Who has built a technical book and targeted more than one output format?