Setup

  1. Using the Jekyll theme of your choice, render the site and copy the CSS styling from it to an Anki note type that you will use for your cards.

Create notes

  1. Add card of note type that supports cloze deletion with code blocks (please see Setup).
  2. Enter dummy cloze and add card
  3. Open in browser
  4. Edit jekyll source file
  5. Build & serve site
  6. vim _site/index.html
  7. /post-c (post-content)
  8. :%s/figure/div/g (x*2 substitutions where x is the number of code blocks)
  9. For each element <div class="highlight">, for each HTML line except the first one, insert a <br> at the beginning of line. In vim select such lines and do :'<,'>s/^/<br>/
  10. For each element <div class="highlight">, join all lines such that the whole element is in a single line.
  11. Validate rendered output.
  12. Copy all to Anki’s Text field on browser
  13. Add cloze deletions to field Text.
  14. Add fields Hint, Extra, Tags.

Fix notes

  1. Open the note field in the HTML editor, and make sure that cloze deletions do not span multiple lines characters, use br elements instead.
  2. Open the note field in the HTML editor and make sure that div elements with class highlight do not span multiple lines. Use br elements instead.