9df5db9269
Update the "Japanese Mined Sentences (cyphar)" template to include the source field (which is now supported by mpvacious). Also rename the model name to match the actual name I use in Anki (but keep the template directory name the same). Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
34 lines
12 KiB
JSON
34 lines
12 KiB
JSON
{
|
|
"modelName": "Japanese Mined Sentences",
|
|
"inOrderFields": [
|
|
"SentKanji",
|
|
"SentFurigana",
|
|
"SentEng",
|
|
"SentAudio",
|
|
"MorphManFocus",
|
|
"VocabKanji",
|
|
"VocabFurigana",
|
|
"VocabPitchPattern",
|
|
"VocabPitchNum",
|
|
"VocabDef",
|
|
"VocabDefMonolingual",
|
|
"VocabAudio",
|
|
"Image",
|
|
"Notes",
|
|
"Source",
|
|
"MakeProductionCard"
|
|
],
|
|
"css": "@font-face {font-family: \"KanjiStrokeOrders\"; src: url('_kso.ttf'); }\n@font-face {font-family: \"Yu Mincho\"; src: url(\"_yumin.ttf\"); }\n@font-face {font-family: \"Yu Mincho\"; src: url(\"_yumindb.ttf\"); font-weight: 600; }\n\n* { box-sizing: border-box; padding: 0; margin: 0; }\n.card {\n\tbackground-color: #FFFAF0;\n\tcolor: #2A1B0A;\n\tfont-family:\t\"Noto Serif\",\n\t\t\t\t\t\t\t\t\t\"Noto Serif CJK JP\",\n\t\t\t\t\t\t\t\t\tYu Mincho,\n\t\t\t\t\t\t\t\t\t\"Liberation Serif\",\n\t\t\t\t\t\t\t\t\t\"Times New Roman\",\n\t\t\t\t\t\t\t\t\tTimes,\n\t\t\t\t\t\t\t\t\tGeorgia,\n\t\t\t\t\t\t\t\t\tSerif;\n\tfont-size: 24px;\n\ttext-align: left;\n\tline-height: 1.4;\n}\n.card1 { }\n.card2 .jpsentence ruby rt { opacity: 0; }\n.card2 .jpsentence:hover ruby rt { opacity: 1; }\n\nhr { margin: 2px 0; clear: both; }\nb { font-weight: 600; }\n\n/* links */\na { color: #585858; }\na:hover { color: #222; }\na.hint { text-decoration: none; text-align: center; display: block; }\n\n/* Hide furigana on front */\nnokana ruby rt { opacity:0.0; font-size:0; display: none; }\nnotext b { background-color: black; color:transparent; }\n\n/* Top */\nheader { font-size: 14px; line-height: 14px; clear: both; }\n\n/* Space between elements */\n.images { margin-top: 16px; }\n.images > img { margin-bottom: 16px; }\n\n/* Japanese sentence */\n.jpsentence { font-size: 35px; }\n\n.tags {\n\tfont-family: \"Noto Sans\", \"Noto Sans CJK JP\", \"Liberation Sans\", Arial, Sans, sans-serif;\n\ttext-align: center;\n\tdisplay: inline-block;\n\ttext-transform: lowercase;\n\tbackground-color: #333;\n\tcolor: #FFFAF0;\n\tfont-weight: bold;\n\tpadding: 1px 3px;\n\tmargin: 0;\n\tcursor: pointer;\n\tborder-radius: 3px;\n\tfont-size: 12px;\n\tline-height: 14px;\n}\n\n/* AnkiDroid peplay button */\n.replaybutton { margin: 0; margin-right: 3px; text-decoration: none; }\n.replaybutton span { padding: 0; font-size: 16px; }\n.replaybutton span svg {\n\tfill: #FFFAF0;\n\tbackground: #333;\n\tborder-radius: 3px;\n\tvertical-align: top; \n\tmin-width: 16px;\n\tmin-height: 16px;\n}\n\n/* PC peplay button */\na.replay-button { top: -.125em; position: relative; }\na.replay-button svg {\n\theight: 1em;\n\twidth: 1em;\n}\na.replay-button svg path { fill: #FFFAF0; }\na.replay-button svg circle { fill: #333; }\n\nfooter { font-size: 16px; text-align: center; }\nfooter>a { text-decoration: none; }\n\n.vocab { margin-top: 16px; }\n.vocab div { display: inline-block; }\n.vocab br { display: none; }\n.vocab > .tags { vertical-align: top; }\n.notes > .tags { vertical-align: bottom; }\n\n.images {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tflex-direction: row;\n\talign-items: flex-start;\n\talign-content: space-between;\n\tjustify-content: space-evenly;\n}\n.images > img {\n\tmax-width: 47%;\n\tborder-radius: 4px;\n\tfilter: sepia(33%);\n}\n.images>img:only-child {\n max-width: 100%;\n}\n\n/* Production cards */\n.production b { visibility: hidden; }\n.strokeorder {\n\ttext-align: center;\n\tfont-size: 150px;\n\tfont-family: KanjiStrokeOrders;\n}\n\n/* Morphman coloring */\n.fside .jpsentence:hover [mtype=unknown] { background-color: #ffff99; }\n.fside .jpsentence:hover [mtype=seen] { background-color: #ffd1b3; }\n.fside .jpsentence:hover [mtype=known] { background-color: #b3e6cc; }\n.fside .jpsentence:hover [mtype=mature] { background-color: transparent; }\n.fside .jpsentence:hover [priority=true] { }\n.fside .jpsentence:hover [frequency=true] { }\n\ndel.MorphManHide {display:none;}\n\n/* Fix for Yomichan defs */\nul, ol {\n list-style-type: none; \n display: inline;\n margin: 0px;\n padding: 0px;\n}\n/* Fix for Yomichan pitch accents */\n.vocab ol > li { display: inline; }\n.vocab ol > li:after { content: \"\u30fb\"; }\n.vocab ol > li:last-child:after { content: \"\"; }",
|
|
"cardTemplates": [
|
|
{
|
|
"Name": "Recognition",
|
|
"Front": "<!--\nmpvacious cards, version 5.0\nWed Jan 6 11:41:21 PM UTC 2021\nModified by Aleksa Sarai <cyphar@cyphar.com>.\n-->\n\n<header>\n\t{{#MorphManFocus}}\n\t\t<div class=\"tags\">{{MorphManFocus}}</div>\n\t{{/MorphManFocus}}\n\t{{#Tags}}\n\t\t<div class=\"tags\">{{Tags}}</div>\n\t{{/Tags}}\n</header>\n\n<div class=\"jpsentence\" lang=\"ja\">\n\t{{morphHighlight:furigana:SentKanji}}\n\t{{^SentKanji}}\n\t\t<nokana>{{kanji:SentFurigana}}</nokana>\n\t{{/SentKanji}}\n</div>\n\n<div style=\"display:none;\">\n\t<div id=\"pitchnum_hidden\">{{VocabPitchNum}}</div>\n\t<div id=\"kanaword_hidden\">{{kana:VocabFurigana}}</div>\n</div>\n\n<script>\n\tfunction boxTargetWord() {\n\t\tfor (sentence of document.getElementsByClassName(\"jpsentence\")) {\n\t\t\tfor (word of sentence.getElementsByTagName(\"b\")) {\n\t\t\t\tword.style[\"border\"] = \"1px\";\n\t\t\t\tword.style[\"border-style\"] = \"dotted\";\n\t\t\t\tword.style[\"border-color\"] = \"#9a9a9a9a\";\n\t\t\t}\n\t\t}\n\t}\n\tdocument.addEventListener('DOMContentLoaded', boxTargetWord(), false);\n</script>",
|
|
"Back": "<div class=\"fside\">{{FrontSide}}</div>\n<hr id=\"answer\">\n<div class=\"jpsentence\" lang=\"ja\">\n\t{{edit:furigana:SentFurigana}}\n\t{{^SentFurigana}}{{furigana:SentKanji}}{{/SentFurigana}}\n</div>\n\n{{#SentEng}}\n\t<div lang=\"en\">\n\t\t{{hint:SentEng}}\n\t</div>\n{{/SentEng}}\n\n<div class=\"vocab\">\n{{VocabAudio}}{{SentAudio}}\n{{VocabPitchPattern}}{{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}\n{{#VocabPitchNum}}<span class=\"tags\" id=\"pitchnum\">{{VocabPitchNum}}</span>{{/VocabPitchNum}}{{#VocabKanji}}\u3010{{VocabKanji}}\u3011{{/VocabKanji}}\n</div>\n\n{{#VocabDefMonolingual}}\n<div class=\"definitions\">{{edit:furigana:VocabDefMonolingual}}</div>\n{{/VocabDefMonolingual}}\n\n{{#VocabDef}}\n{{#VocabDefMonolingual}}\n<div class=\"definitions\">{{edit:hint:furigana:VocabDef}}</div>\n{{/VocabDefMonolingual}}\n{{^VocabDefMonolingual}}\n<div class=\"definitions\">{{edit:furigana:VocabDef}}</div>\n{{/VocabDefMonolingual}}\n{{/VocabDef}}\n\n{{#Notes}}\t\n<div class=\"notes\">\n\t<div class=\"tags\">Notes</div>\n\t<div>{{furigana:Notes}}</div>\n</div>\n{{/Notes}}\n\n{{#Image}}<div class=\"images\">{{Image}}</div>{{/Image}}\n\n\n<hr>\n<footer>\n\t{{#SentKanji}}\n\t\t<a href=\"https://jisho.org/search?keyword={{kanji:text:SentKanji}}\" title=\"Sentence on Jisho\">Jisho</a>\n\t\t<a href=\"https://www.google.co.jp/search?q={{kanji:text:SentKanji}}&tbm=isch\" title=\"Search images\">Images</a>\n\t{{/SentKanji}}\n\t{{#VocabKanji}}\n\t\t<a href=\"http://www.weblio.jp/content/{{text:VocabKanji}}\">Weblio</a>\n\t\t<a href=\"https://wadoku.de/search/?q={{text:VocabKanji}}\">Wadoku</a>\n\t{{/VocabKanji}}\n\t{{#Source}}\n\t<div>\n\t\t<div class=\"tags\">Source</div>\n\t\t<div id=\"source-ref\">{{Source}}</div>\n\t</div>\n\t{{/Source}}\n</footer>\n\n<script>\n/*\nPaints the question word according to its Pitch Accent number.\n\tblue for \u5e73\u677f\n\tred for \u982d\u9ad8\n\torange for \u4e2d\u9ad8\n\tgreen for \u5c3e\u9ad8\n*/\n\n\tfunction markPitch() {\n\t\tvar pitchNumber = document.getElementById(\"pitchnum_hidden\");\n\t\tif (pitchNumber === null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpitchNumber = pitchNumber.innerHTML.match(/\\d/);\n\t\t}\n\t\tif (pitchNumber === null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpitchNumber = Number(pitchNumber);\n\t\t}\n\n\t\t/* Then decide what color to use and change font color accordingly. */\n\t\tif ( pitchNumber == 0 ) {\n\t\t\t// use blue for \u5e73\u677f\n\t\t\tpaintTargetWord(\"#3366CC\");\n\t\t} else if ( pitchNumber == 1 ) {\n\t\t\t// use red for \u982d\u9ad8\n\t\t\tpaintTargetWord(\"red\");\n\t\t} else if ( pitchNumber > 1 ) {\n\t\t\tif ( odaka(pitchNumber) ) {\n\t\t\t\t// use green for \u5c3e\u9ad8\n\t\t\t\tpaintTargetWord(\"green\");\n\t\t\t} else {\n\t\t\t\t// use orange for \u4e2d\u9ad8\n\t\t\t\tpaintTargetWord(\"#ff6207\");\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction paintTargetWord(color) {\n\t\tfor (sentence of document.getElementsByClassName(\"jpsentence\")) {\n\t\t\tfor (word of sentence.getElementsByTagName(\"b\")) {\n\t\t\t\tword.style.color = color;\n\t\t\t\t// clear border on back side of cards\n\t\t\t\tword.style[\"border\"] = \"0px\";\n\t\t\t\tword.style[\"border-style\"] = \"none\";\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction odaka(pitch_num) {\n\t\t// word is odaka if number of moras is equal to pitch accent position\n\t\tconst vocab_kana = document.getElementById(\"kanaword_hidden\");\n\t\tif (vocab_kana === null) {\n\t\t\treturn false;\n\t\t}\n\t\t// small \u3063 is one mora; \u3083\u3085\u3087 are parts of single mora\n\t\tconst n_moras = vocab_kana.innerHTML.replace(/[\u30e3\u30e5\u30e7\u3083\u3085\u3087]/g, '').length;\n\t\tif ( n_moras == pitch_num ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction removePitchBrackets() {\n\t\tconst tags = document.getElementById(\"pitchnum\");\n\t\tif (tags === null)\n\t\t\treturn;\n\t\ttags.innerHTML = tags.innerHTML.replace(/(\\[(?=\\d)|(?<=\\d)\\])/g, \"\");\n\t}\n\n\tfunction hideBadSource() {\n\t\tconst yomi_source = document.getElementById(\"yomichan-source\");\n\t\tif (yomi_source === null)\n\t\t\treturn;\n\t\tvar any_valid = false;\n\t\tfor (link of yomi_source.getElementsByTagName(\"a\")) {\n\t\t\ttry {\n\t\t\t\tlet url = new URL(link.href);\n\t\t\t\tif (url.protocol === \"moz-extension:\")\n\t\t\t\t\tlink.style[\"display\"] = \"none\";\n\t\t\t\telse\n\t\t\t\t\tany_valid = true;\n\t\t\t} catch {\n\t\t\t\t// ...\n\t\t\t}\n\t\t}\n\t\tif (!any_valid) {\n\t\t\tyomi_source.style[\"display\"] = \"none\";\n\t\t\tconst yomi_screenshot = document.getElementById(\"yomichan-screenshot\");\n\t\t\tif (yomi_screenshot !== null)\n\t\t\t\tyomi_screenshot.style[\"display\"] = \"none\";\n\t\t}\n\t}\n\n\tdocument.addEventListener('DOMContentLoaded', markPitch(), false);\n\tdocument.addEventListener('DOMContentLoaded', removePitchBrackets(), false);\t\n\tdocument.addEventListener('DOMContentLoaded', hideBadSource(), false);\n</script>"
|
|
},
|
|
{
|
|
"Name": "Production",
|
|
"Front": "{{#MakeProductionCard}}\n{{#SentKanji}}\n\n<header>{{#Tags}}<div class=\"tags\">{{Tags}}</div>{{/Tags}}</header>\n{{#Image}}<div class=\"images\" >{{Image}}</div>{{/Image}}\n<div class=\"jpsentence production\">{{furigana:SentFurigana}}</div>\n<div style=\"text-align: center;\">{{VocabAudio}}{{SentAudio}}</div>\n<script>\n\tdocument.addEventListener('DOMContentLoaded', threeDots(), false);\n\n\tfunction threeDots() {\n\t\tconst sent = document.getElementsByClassName(\"production\")[0];\n\t\tif (sent) {\n\t\t\tconst hidden = sent.getElementsByTagName(\"b\");\n\t\t\tfor (i = 0; i < hidden.length; i++) {\n\t\t\t\tif (hidden[i]) {\n\t\t\t\t\thidden[i].style.visibility = \"visible\";\n\t\t\t\t\t//hidden[i].innerText = \"\u3010{{kana:VocabFurigana}}\u3011\";\n\t\t\t\t\thidden[i].innerText = \"\u3010\"+hidden[i].innerText.replace(/[^\u3041-\u3093\u30a1-\u30f3]/g, \"\")+\"\u3011\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n{{/SentKanji}}\n{{/MakeProductionCard}}",
|
|
"Back": "{{FrontSide}}\n\n<hr>\n\n<div lang=\"en\" >{{SentEng}}</div>\n<div class=\"strokeorder\">{{VocabKanji}}</div>\n\n{{#VocabKanji}}\n\t<div class=\"vocab\">\n\t\t{{VocabPitchPattern}}\n\t\t{{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}\n\t\t{{#VocabPitchNum}}\n\t\t\t<span class=\"tags\">{{VocabPitchNum}}</span>\n\t\t{{/VocabPitchNum}}\n\t\t\u3010{{VocabKanji}}\u3011\n\t</div>\n{{/VocabKanji}}\n\n{{#VocabDef}}\t\n\t<div class=\"definitions\">\n\t\t{{furigana:VocabDef}}\n\t</div>\n{{/VocabDef}}\n\n{{#Notes}}\t\n\t<div class=\"notes\">\n\t\t<div class=\"tags\">Notes</div>\n\t\t<div>{{furigana:Notes}}</div>\n\t</div>\n{{/Notes}}\n\n<hr>\n\n<footer>\n\t{{#SentKanji}}\n\t\t<a href=\"https://jisho.org/search?keyword={{text:SentKanji}}\" title=\"Sentence on Jisho\">Jisho</a>\n\t\t<a href=\"https://www.google.co.jp/search?q={{text:SentKanji}}&tbm=isch\" title=\"Search images\">Images</a>\n\t{{/SentKanji}}{{#VocabKanji}}\n\t\t<a href=\"http://tangorin.com/dict.php?dict=general&s={{text:VocabKanji}}\">Tangorin</a>\n\t\t<a href=\"http://www.weblio.jp/content/{{text:VocabKanji}}\">Weblio</a>\n\t\t<a href=\"https://wadoku.de/search/?q={{text:VocabKanji}}\">Wadoku</a>\n\t{{/VocabKanji}}\n</footer>"
|
|
}
|
|
]
|
|
} |