Skip to content

psygo/template_tsumego_ebook

Repository files navigation

Template Tsumego eBook

I've also written a companion article on my website.

A lab for learning how to write a Go, mainly tsumegos, EPUB ebook.

EPUBs are basically HTML files. For instance, if you open any of GoBooks books with a text editor, besides some many unicode errors, you will note that it is composed of 90% HTML and 10% embedded Chinese JavaScript for the diagrams.

Useful resources for studying EPUBs:

Pandoc

So far, the most practical way of creating an EPUB book seems to be Pandoc. Adobe InDesign — or Word, or Google Docs? — is also able to do it.

Here are some useful resources:

The essential workflow of developing an EPUB (or PDF) tsumego book in this manner is:

  1. Create the problem inside GoWrite, with likely at least 3 diagrams, problem, solution, mistake.
  2. Export the diagrams to vector images.
  3. Mention the diagrams inside the markdown file.
  4. Add the necessary text to make it more understandable.

Compiling to EPUB

pandoc <file.md> -o <file.epub>

You can also add custom CSS to it.

Compiling to PDF

Note that using HTML inside Markdown doesn't seem to work when compiling to PDF with Pandoc, unlike EPUB.

pandoc <file.md> -o <file.pdf>

GoWrite

For Go diagrams, I highly recommend GoWrite2, it won't be as slick as GoBooks interactive diagrams, but it's enough.

GoWrite2 can be a bit tricky to use, depending on what you want. Here are some tips and best practices:

  • In general, do use vector images for diagrams, this way there won't be any pixelation on them. The main two vector formats in GoWrite2 are:
    • SVG
    • EPS
  • When showing only part of the board in a diagram, crop it in the editing tab, not on the board, otherwise there will be a bunch of empty space in the resulting image.
  • SVG is basically text, so you can inspect it and change it through an editor. If you dislike anything about GoWrite's results, do change it.
    • For example, I think it would look better to have black thicker lines around the White stones. So I simply would change White stones to have .35 thickness: stroke="black" stroke-width="0.35px".
  • If you want to open or convert the diagrams other formats, I recommend either using GIMP or Inkscape, which are both free.

EPUB Readers

Most EPUB readers are incredibly unpleasant or ugly. The only ones I've found so far which are good enough: