hhzl / LearnWords2

A word learning component (Leitner system) and word list conversion functions
MIT License
11 stars 2 forks source link

Define a JSON/YAML specification for printout of flash cards #186

Closed hhzl closed 7 years ago

hhzl commented 7 years ago

The specs then may be rendered with the following tasks

Alternatively we could think of using a procedural style. An example:

newPage
numberOfColumns: 4
numberOfRows: 5
putPicture: 'ant.jpg'
selectLabelFont: aFontName
selectLabelFontSize: 24
putLabelBelowCentered: 'ant'
selectNextCell
putPicture: 'ant.jpg'
putLabelBelowCentered: 'ant'
.....
selectFirstCellOfNextRow
putPicture: 'butterfly.jpg'
putLabelBelowCentered: 'butterfly'
selectNextCell
putPicture: 'calf.jpg'
putLabelBelowCentered: 'calf'
hhzl commented 7 years ago

The task json2htmlCardList constructs an intermediary file format with structured data in the folder data-export

<hr>
<article>
<span class="idOfKey">1</span>
<span class="word">antelope</span>
<span class="translate">die Antilope</span>
<span class="tags">animal</span>
<img src="c10/antelope.jpg" />
</article>

<hr>
<article>
<span class="idOfKey">2</span>
<span class="word">ant</span>
<span class="translate">die Ameise</span>
<span class="tags">animal</span>
<img src="c10/ant.jpg" />
</article>

<hr>
<article>
<span class="idOfKey">3</span>
<span class="word">baboon</span>
<span class="translate">der Pavian</span>
<span class="tags">animal</span>
<img src="c10/baboon.jpg" />
</article>

Another project may use this format to create printed versions for the flash cards.

So no YAML needed at the moment.