aboutsummaryrefslogtreecommitdiff
path: root/tmpl/fields.html
blob: 8bd94dc005e96180312b06cfac4cddc10fbabe7f (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{{#*inline "glossary-single"}}
    {{~#if html~}}
        {{~#unless brief~}}
            {{~#if tags~}}<i>({{#each tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}})</i> {{/if~}}
        {{~/unless~}}
        {{~#if glossary.[1]~}}
            <ul>{{#each glossary}}<li>{{#multiLine}}{{.}}{{/multiLine}}</li>{{/each}}</ul>
        {{~else~}}
            {{~#multiLine}}{{glossary.[0]}}{{/multiLine~}}
        {{~/if~}}
    {{~else~}}
        {{~#unless brief~}}
            {{~#if tags~}}({{#each tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}}) {{/if~}}
        {{~/unless~}}
        {{~#if glossary.[1]~}}
            {{#each glossary}}{{.}}{{#unless @last}}, {{/unless}}{{/each}}
        {{~else~}}
            {{glossary.[0]}}
        {{~/if~}}
    {{~/if~}}
{{/inline}}

{{#*inline "audio"}}{{/inline}}

{{#*inline "character"}}
    {{~definition.character~}}
{{/inline}}

{{#*inline "dictionary"}}
    {{~definition.dictionary~}}
{{/inline}}

{{#*inline "expression"}}
    {{~#if modeTermKana~}}
        {{~#if definition.reading~}}
            {{definition.reading}}
        {{~else~}}
            {{definition.expression}}
        {{~/if~}}
    {{~else~}}
        {{definition.expression}}
    {{~/if~}}
{{/inline}}

{{#*inline "furigana"}}
    {{~#if html~}}
        {{~#definition.furigana~}}
            {{~#if furigana~}}
                <ruby>{{text}}<rt>{{furigana}}</rt></ruby>
            {{~else~}}
                {{text}}
            {{/if~}}
        {{~/definition.furigana~}}
    {{~else~}}
        {{#definition.furigana}}
            {{~#furigana}} {{/furigana~}}
            {{text}}
            {{~#furigana}}[{{.}}]{{/furigana~}}
        {{/definition.furigana}} 
    {{~/if~}}
{{/inline}}

{{#*inline "glossary"}}
    {{~#if html}}<div style="text-align: left;">{{/if~}}
    {{~#if modeKanji~}}
        {{~#if definition.glossary.[1]~}}
            {{~#if html}}<ol>{{#each definition.glossary}}<li>{{.}}</li>{{/each}}</ol>
            {{~else}}{{#each definition.glossary}}{{.}}{{#unless @last}}, {{/unless}}{{/each}}{{/if~}}
        {{~else~}}
            {{definition.glossary.[0]}}
        {{~/if~}}
    {{~else~}}
        {{~#if group~}}
            {{~#if definition.definitions.[1]~}}
                {{~#if html}}<ol>{{#each definition.definitions}}<li>{{> glossary-single html=../html brief=../brief}}</li>{{/each}}</ol>
                {{~else}}{{#each definition.definitions}} * {{> glossary-single html=../html brief=../brief}}{{/each}}{{/if~}}
            {{~else~}}
                {{~> glossary-single definition.definitions.[0] html=html brief=brief~}}
            {{~/if~}}
        {{~else~}}
            {{~> glossary-single definition html=html brief=brief~}}
        {{~/if~}}
    {{~/if~}}
    {{~#if html}}</div>{{/if~}}
{{/inline}}

{{#*inline "glossary-brief"}}
    {{~> glossary brief=true ~}}
{{/inline}}

{{#*inline "kunyomi"}}
    {{~#each definition.kunyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
{{/inline}}

{{#*inline "onyomi"}}
    {{~#each definition.onyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
{{/inline}}

{{#*inline "reading"}}
    {{~#unless modeTermKana}}{{definition.reading}}{{/unless~}}
{{/inline}}

{{#*inline "sentence"}}
    {{~#if definition.cloze}}{{definition.cloze.sentence}}{{/if~}}
{{/inline}}

{{#*inline "cloze-prefix"}}
    {{~#if definition.cloze}}{{definition.cloze.prefix}}{{/if~}}
{{/inline}}

{{#*inline "cloze-body"}}
    {{~#if definition.cloze}}{{definition.cloze.body}}{{/if~}}
{{/inline}}

{{#*inline "cloze-suffix"}}
    {{~#if definition.cloze}}{{definition.cloze.suffix}}{{/if~}}
{{/inline}}

{{#*inline "tags"}}
    {{~#each definition.tags}}{{name}}{{#unless @last}}, {{/unless}}{{/each~}}
{{/inline}}

{{#*inline "url"}}
    {{~#if html}}<a href="{{definition.url}}">{{definition.url}}</a>{{else}}{{definition.url}}{{/if~}}
{{/inline}}

{{~> (lookup . "marker") ~}}