diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-01-04 23:22:43 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-01-04 23:22:43 +0100 |
commit | 0b88c834b74f5f7b009f6383870724f15ddcb4b5 (patch) | |
tree | 76ac6ddbd4ea71d882c8b4c537ceca9296f824f6 /anki-card-template | |
parent | 39aae80a3106ec6c5e792ab2934edb0425a63618 (diff) |
move duplicated code to separate m4 file
Diffstat (limited to 'anki-card-template')
-rw-r--r-- | anki-card-template/back-template.m4 | 17 | ||||
-rw-r--r-- | anki-card-template/front-template.m4 | 10 | ||||
-rw-r--r-- | anki-card-template/makefile | 4 | ||||
-rw-r--r-- | anki-card-template/template.m4 | 14 |
4 files changed, 20 insertions, 25 deletions
diff --git a/anki-card-template/back-template.m4 b/anki-card-template/back-template.m4 index f2e0e0a..79504dc 100644 --- a/anki-card-template/back-template.m4 +++ b/anki-card-template/back-template.m4 @@ -1,15 +1,2 @@ -<div id="card" class="back horizontal-layout"> -<div id="front"> -<span id="sentence" class="parse foreign">{{Complete sentence}}</span> -</div> -<hr id="separator"> -<div id="back"> -<span id="target-word-reading" class="foreign">{{Target word reading}}</span> -<span id="target-word-translation" class="native">{{Target word translation}}</span> -<span id="sentence-translation" class="native spoiler hidden">{{Complete sentence translation}}</span> -</div> -</div> - -<style>undivert(`card.min.css')</style> -<script defer>undivert(`card.min.js')</script> - +define(`CARD_SIDE', `back')dnl +include(`template.m4')dnl diff --git a/anki-card-template/front-template.m4 b/anki-card-template/front-template.m4 index 470cc56..dbfc810 100644 --- a/anki-card-template/front-template.m4 +++ b/anki-card-template/front-template.m4 @@ -1,9 +1,3 @@ -<div id="card" class="front horizontal-layout"> -<div id="front"> -<span id="sentence" class="parse foreign">{{Complete sentence}}</span> -</div> -</div> - -<style>undivert(`card.min.css')</style> -<script defer>undivert(`card.min.js')</script> +define(`CARD_SIDE', `front')dnl +include(`template.m4')dnl diff --git a/anki-card-template/makefile b/anki-card-template/makefile index deb4c29..c9a5ce7 100644 --- a/anki-card-template/makefile +++ b/anki-card-template/makefile @@ -5,8 +5,8 @@ all: back-template.html front-template.html include ../common.mk -back-template.html: card.min.js card.min.css -front-template.html: card.min.js card.min.css +back-template.html: card.min.js card.min.css template.m4 +front-template.html: card.min.js card.min.css template.m4 clean: $(RM) back-template.html front-template.html card.min.js card.min.css diff --git a/anki-card-template/template.m4 b/anki-card-template/template.m4 new file mode 100644 index 0000000..9168c52 --- /dev/null +++ b/anki-card-template/template.m4 @@ -0,0 +1,14 @@ +<div id="card" class="CARD_SIDE() horizontal-layout"> +<div id="front"> +<span id="sentence" class="parse foreign">{{Complete sentence}}</span> +</div> +<hr id="separator"> +<div id="back"> +<span id="target-word-reading" class="foreign">{{Target word reading}}</span> +<span id="target-word-translation" class="native">{{Target word translation}}</span> +<span id="sentence-translation" class="native spoiler hidden">{{Complete sentence translation}}</span> +</div> +</div> + +<style>undivert(`card.min.css')</style> +<script defer>undivert(`card.min.js')</script> |