diff --git a/build/apkg.py b/build/apkg.py index 5b90a62045ea6189468519a7bcb8df99d48d34e5..74fd95beaa4a84585785825d85295e52b1baed69 100755 --- a/build/apkg.py +++ b/build/apkg.py @@ -8,12 +8,18 @@ import sys templates = [ ( # if this key phrase is found on the front template - "anki-template-hanyu-speak", + "facts-q-a-front", # then use front.html and back.html in this directory for the card type - "templates/molaoshi/speak", + "templates/facts/q_a", # and for skeleton apkg use this front HTML - "anki-template-hanyu-speak-front {{Deutsch}}", + "facts-q-a-front {{Front}}", # and this back HTML + "facts-q-a-back {{Back}}" + ), + ( + "anki-template-hanyu-speak", + "templates/molaoshi/speak", + "anki-template-hanyu-speak-front {{Deutsch}}", "anki-template-hanyu-speak-back {{Pīnyīn}}" ), ( diff --git a/package.json b/package.json index 48361889b6713e34d01d2c5138ad049e37860d25..7c3f26e7041fcd0a379949def754c2677854e488 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anki-template-hanyu", - "version": "1.0.1", + "version": "1.1.0", "description": "Anki template for learning to write, speak and understand Mandarin Chinese", "repository": "https://github.com/tapirbug/anki-template-hanyu", "author": "Philipp Stadler <hello@phstadler.com>", @@ -25,6 +25,8 @@ }, "source": [ "src/index.html", + "src/templates/facts/q_a/front.html", + "src/templates/facts/q_a/back.html", "src/templates/hanzi/read/front.html", "src/templates/hanzi/read/back.html", "src/templates/hanzi/write/front.html", diff --git a/src/components/facts.css b/src/components/facts.css new file mode 100644 index 0000000000000000000000000000000000000000..85dc9ec497520973bc3bbd6a3ac63bffa16a706b --- /dev/null +++ b/src/components/facts.css @@ -0,0 +1,6 @@ +.facts-question, .facts-answer { + text-align: left; + max-width: 60em; + margin-left: auto; + margin-right: auto; +} diff --git a/src/components/global.css b/src/components/global.css index 2f4c36f4782469b833911af6c3fe081faa2aaaa3..920f46893784f7e2de5a7b2c9b4d692dc826edc9 100644 --- a/src/components/global.css +++ b/src/components/global.css @@ -8,13 +8,26 @@ text-align: center; } -.exercise-kind { +.exercise-kind, .exercise-category { font-size: 0.7rem; color: rgba(0, 0, 0, 0.5); - text-align: left; + margin-bottom: 1.5em; +} + +.exercise-kind { + float: left; +} + +.exercise-category { + float: right; +} + +.prompt { + clear: both; } -.nightMode .exercise-kind { +.nightMode .exercise-kind, +.nightMode .exercise-category { color: rgba(255, 255, 255, 0.5); } diff --git a/src/index.html b/src/index.html index 34da6eeea5d578c967c89a2ef174a48fe3581210..32a4297607195299b910be1397892f7acbcb4539 100644 --- a/src/index.html +++ b/src/index.html @@ -9,6 +9,13 @@ <body> <h1>Overview</h1> + <h2>templates/facts</h2> + <h3>Q/A</h3> + <h4>Front</h4> + <a href="templates/facts/q_a/front.html">read/front.html</a> + <h4>Back</h4> + <a href="templates/facts/q_a/back.html">read/back.html</a> + <h2>templates/hanzi</h2> <h3>Read</h3> <h4>Front</h4> diff --git a/src/templates/facts/q_a/back.html b/src/templates/facts/q_a/back.html new file mode 100644 index 0000000000000000000000000000000000000000..2b5c8246df694da27ef631238df196c7f3cfa327 --- /dev/null +++ b/src/templates/facts/q_a/back.html @@ -0,0 +1,13 @@ +<div class="exercise back facts-q-a-back"> + {{FrontSide}} + + <hr id="answer"> + + <div class="facts-answer"> + {{Back}} + </div> +</div> + +<script type="module"> + import '../../../components/debug' +</script> \ No newline at end of file diff --git a/src/templates/facts/q_a/front.html b/src/templates/facts/q_a/front.html new file mode 100644 index 0000000000000000000000000000000000000000..a035d5fe072098bf720371259df9d4943289af3a --- /dev/null +++ b/src/templates/facts/q_a/front.html @@ -0,0 +1,23 @@ +<style> + @import url(../../../components/global.css); + @import url(../../../components/facts.css); +</style> + +<div class="exercise front facts-q-a-front"> + <aside class="exercise-kind"> + {{Card}} + </aside> + <aside class="exercise-category"> + {{Subdeck}} + </aside> + + <div class="prompt facts-question"> + {{Front}} + </div> + + <include src="src/components/notice/notice.html"></include> +</div> + +<script type="module"> + import '../../../components/debug' +</script> \ No newline at end of file diff --git a/src/templates/hanzi/read/front.html b/src/templates/hanzi/read/front.html index a525950caef80deda2a5b2a266ff4a4e5d969a58..161aedc7eba385aeb43f2b131f84f7f3f8745efa 100644 --- a/src/templates/hanzi/read/front.html +++ b/src/templates/hanzi/read/front.html @@ -7,7 +7,7 @@ {{Card}} </aside> - <dl class="translations"> + <dl class="prompt translations"> <dt> 汉字 </dt> diff --git a/src/templates/hanzi/write/front.html b/src/templates/hanzi/write/front.html index d4f61a84e13e9702529bea1cea7b22ed807e57b4..81b5ca0c8ef795818e4980e4e20ceee9dd54b147 100644 --- a/src/templates/hanzi/write/front.html +++ b/src/templates/hanzi/write/front.html @@ -7,7 +7,7 @@ {{Card}} </aside> - <dl class="translations"> + <dl class="prompt translations"> <dt> Key word </dt> diff --git a/src/templates/molaoshi/hear/front.html b/src/templates/molaoshi/hear/front.html index bfd29f51d3194db8834134ac25898d2a2486a33e..3a5de6fadcff929392f1358059173162c484c698 100644 --- a/src/templates/molaoshi/hear/front.html +++ b/src/templates/molaoshi/hear/front.html @@ -7,7 +7,7 @@ {{Card}} </aside> - <dl class="translations"> + <dl class="prompt translations"> <dt> 汉语 </dt> diff --git a/src/templates/molaoshi/read_hanzi/front.html b/src/templates/molaoshi/read_hanzi/front.html index 0777487253739e2ffd43f9986cd34cd2c9d64c24..8adeaad88700fec1abff7697a4b49e841c8d9bea 100644 --- a/src/templates/molaoshi/read_hanzi/front.html +++ b/src/templates/molaoshi/read_hanzi/front.html @@ -7,7 +7,7 @@ {{Card}} </aside> - <dl class="translations"> + <dl class="prompt translations"> <dt> 汉字 </dt> diff --git a/src/templates/molaoshi/read_pinyin/front.html b/src/templates/molaoshi/read_pinyin/front.html index bbc03de3cd982d983e7c5235fd01e546e84c2be0..89e3a4693b7b3464c7d9864b19fcc9bfdaf0e80b 100644 --- a/src/templates/molaoshi/read_pinyin/front.html +++ b/src/templates/molaoshi/read_pinyin/front.html @@ -7,7 +7,7 @@ {{Card}} </aside> - <dl class="translations"> + <dl class="prompt translations"> <dt> Pīnyīn </dt> diff --git a/src/templates/molaoshi/speak/front.html b/src/templates/molaoshi/speak/front.html index af566733e38b1def682473fe9213e6fd521bdf43..53e5b05904c81d65727f2367f4c500ad72f9cb5f 100644 --- a/src/templates/molaoshi/speak/front.html +++ b/src/templates/molaoshi/speak/front.html @@ -7,7 +7,7 @@ {{Card}} </aside> - <dl class="translations"> + <dl class="prompt translations"> <dt> Deutsch </dt> diff --git a/src/templates/molaoshi/write/front.html b/src/templates/molaoshi/write/front.html index 8da076a21d18fc3641b1906e8b23a7134669d490..808597108f5570a6d590d9b7f71c96693cd2b92b 100644 --- a/src/templates/molaoshi/write/front.html +++ b/src/templates/molaoshi/write/front.html @@ -7,7 +7,7 @@ {{Card}} </aside> - <dl class="translations"> + <dl class="prompt translations"> <dt> Deutsch </dt>