Ask HN: How to format self-published eBooks?

I'm looking for people who have already published a (technical) eBook to multiple platforms. These platforms need different file formats such as .epub and .mobi.

1) Which tools can you recommend to convert to .epub and .mobi?

2) How do these tools deal with code syntax highlighting? (highlight changed lines of code, format to nice code blocks etc.)

3) What input file format do these tools use?

4) How flexible can you adjust the output in these tools? E.g. you have a longer block of code and don't want to split it up between two pages.

  • I use Markdown for everything. If you're interested I have a a free guide that shows you the open source tools I use for releasing pdf, epub, mobi and html books based on Markdown.

    The tools I use cover all points in your list.

    https://nickjanetakis.com/blog/configure-your-code-editor-to...

  • In order to be able to convert in multiple formats, you need a base format that's universal and well documented: that's text format. But you need to be able to add formatting & more, so the format could be either LaTeX or Markdown.

    To convert formats, pandoc[1] looks to be the standard.

    [1] http://pandoc.org/