-
Notifications
You must be signed in to change notification settings - Fork 0
/
anki_tag.ts
58 lines (55 loc) · 1.54 KB
/
anki_tag.ts
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
const NAMESPACE_QUIZGEN = 'qg'
/**
* Prefix plain tag name with quizgen namespace.
*
* @param tag_suffix Plain tag name.
*/
function ns(tag_suffix: string): string {
return `${NAMESPACE_QUIZGEN}-${tag_suffix}`
}
/**
* Special generated anki tags.
*/
export class AnkiTag {
/**
* Any note generated by quizcard generator.
*/
public static readonly QUIZGEN = ns('quizcard-generator')
/**
* No testable words included in this note.
*/
public static readonly NOT_TESTABLE = ns('not-testable')
}
/**
* Anki tags used to control behavior in card rendering.
*/
export class RenderControlTag extends AnkiTag {
/**
* Render log messages in a text area near the bottom of the card.
*/
public static readonly SHOW_LOGGING = ns('show-logging')
/**
* Show the multiple choices for the tested word.
*/
public static readonly SHOW_CHOICES = ns('show-choices')
/**
* Show the note's source file.
*/
public static readonly SHOW_SOURCE_FILE = ns('show-source-file')
/**
* Show the note's line number in its source file.
*/
public static readonly SHOW_SOURCE_LINE = ns('show-source-line')
/**
* Shuffle choices randomly on render.
*/
public static readonly SHOW_RANDOMIZED = ns('show-randomized')
/**
* Show preceding text from the source file.
*/
public static readonly SHOW_PROLOGUE = ns('show-prologue')
/**
* Show following text from the source file.
*/
public static readonly SHOW_EPILOGUE = ns('show-epilogue')
}