Setup
- 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
- Add card of note type that supports cloze deletion with code blocks (please
see Setup).
- Enter dummy cloze and add card
- Open in browser
- Edit jekyll source file
- Build & serve site
vim _site/index.html
/post-c
(post-content)
:%s/figure/div/g
(x*2 substitutions where x is the number of code blocks)
- 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>/
- For each element
<div class="highlight">
, join all lines such that the
whole element is in a single line.
- Validate rendered output.
- Copy all to Anki’s Text field on browser
- Add cloze deletions to field Text.
- Add fields Hint, Extra, Tags.
Fix notes
- Open the note field in the HTML editor, and make sure that cloze deletions
do not span multiple lines characters, use
br
elements instead.
- 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.