blob: 9de275db87476cc0ac51c24581cc082662364b44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# anki sentence mining template
work in progress
this is an anki card template for sentence mining. it has fields for a foreign
sentence, foreign word, translated word and an optional translated sentence. it
supports a markdown-like [syntax](#syntax) for adding furigana that is visible
on either both sides or only on the back side.
## example
### input
|Field|Value|
|-|-|
|Complete sentence|`[家](うち)の{主}(あるじ)を*なめるなよ*…`|
|Target word reading|`舐める【なめる】`|
|Target word translation|`To underestimate`|
|Complete sentence translation|`Don't underestimate the master of the house...`|
### front
<div class="card front" align="center" style="border: solid 2px gray; padding: 10px;">
<span class="sentence parsed">家の<ruby>主<rt class="visible">あるじ</rt></ruby>を<b>なめるなよ</b>…</span>
</div>
### back
<div class="card back" align="center" style="border: solid 2px gray; padding: 10px;">
<span class="sentence parsed"><ruby>家<rt class="hidden">うち</rt></ruby>の<ruby>主<rt class="visible">あるじ</rt></ruby>を<b>なめるなよ</b>…</span>
<hr class="split">
<span class="target-word-reading">舐める【なめる】</span><br>
<span class="target-word-translation">To underestimate</span><br>
<span class="sentence-translation">Don't underestimate the master of the house...</span>
</div>
## syntax
html is passed through, so inline styling (should) still work.
|input|html output|example|
|-|-|-|
|`[kanji](furigana)`|`<ruby>kanji<rt>furigana</rt></ruby>`<br>(furigana visible on back side only)|<ruby>kanji<rt>furigana</rt></ruby>|
|`{kanji}(furigana)`|`<ruby>kanji<rt>furigana</rt></ruby>`<br>(furigana visible on both sides)|<ruby>kanji<rt>furigana</rt></ruby>|
|`*text*`|`<b>text</b>` (bold)|<b>text</b>|
|`a\nb`|`a<br>b` (line break)|a<br>b|
|`\\`|`\` (backslash)|\\|
|`\[escaped](this)`|`[escaped](this)` (escaped furigana)|\[escaped](this)|
## set-up
i don't know how to create a teplate deck (if that's even a thing), so these
are instructions to apply to an empty deck.
1. run `make` to generate files
2. Under Tools > Manage note types > (note type here) > Fields, make sure the
following fields exist (might be case-sensitive):
| |name|description|
|-|----|-----------|
|1|Complete sentence|Complete sentence with furigana and target word in bold|
|2|Target word reading|Dictionary reading of word (with word type)|
|3|Target word translation|(In context) translation of target word|
|4|Complete sentence translation|Complete sentence translation|
3. In the 'Browse' view, click on Cards... (you might need to create a
temporary card in a deck) and paste the contents of front-template.html and
back-template.html in the front template and back template of the card type.
Make sure the Styling tab doesn't contain any code as this will override the
built-in styles.
4. Profit
|