NiloCK / vue-skuilder

3 stars 0 forks source link

Implement an 'Anki Card' type #24

Open NiloCK opened 6 years ago

NiloCK commented 6 years ago

Anki displays cards as a function of

A view should exist to render anki cards from these input dataShapes, in order to facilitate imports from anki.

CrowdAnki exports anki decks to json files, where the shape of each of these parameters is as folllows:

/* Two different templates */
{
            "__type__": "NoteModel", 
            "crowdanki_uuid": "383671d6-79af-11e8-94bb-40f02f569107", 
            "css": ".card {\n font-family: arial;\n font-size: 40px;\n text-align: center;\n color: black;\n background-color: white;\n}\n", 
            "flds": [
                {
                    "font": "Arial", 
                    "media": [], 
                    "name": "Front", 
                    "ord": 0, 
                    "rtl": false, 
                    "size": 20, 
                    "sticky": false
                }, 
                {
                    "font": "Arial", 
                    "media": [], 
                    "name": "Back", 
                    "ord": 1, 
                    "rtl": false, 
                    "size": 20, 
                    "sticky": false
                }
            ], 
            "latexPost": "\\end{document}", 
            "latexPre": "\\documentclass[12pt]{article}\n\\special{papersize=3in,5in}\n\\usepackage[utf8]{inputenc}\n\\usepackage{amssymb,amsmath}\n\\pagestyle{empty}\n\\setlength{\\parindent}{0in}\n\\begin{document}\n", 
            "name": "SiteWord-cef25", 
            "req": [
                [
                    0, 
                    "all", 
                    [
                        0
                    ]
                ]
            ], 
            "sortf": 0, 
            "tags": [], 
            "tmpls": [
                {
                    "afmt": "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}\n\n", 
                    "bafmt": "", 
                    "bqfmt": "", 
                    "did": null, 
                    "name": "Card 1", 
                    "ord": 0, 
                    "qfmt": "{{Front}}\n\n<br>\n<br>\n\n<div id=\"pips\"></div>\n\n<script>\nvar div = document.getElementById(\"pips\");\nsetTimeout(function(){\n  //div.innerHTML = div.innerHTML + \"*\";\n}, 3000);\n</script>"
                }
            ], 
            "type": 0, 
            "vers": []
        }, 
        {
            "__type__": "NoteModel", 
            "crowdanki_uuid": "38364ac0-79af-11e8-b58c-40f02f569107", 
            "css": ".card {\n font-family: arial;\n font-size: 20px;\n text-align: center;\n color: black;\n background-color: white;\n}", 
            "flds": [
                {
                    "font": "Arial", 
                    "media": [], 
                    "name": "Front", 
                    "ord": 0, 
                    "rtl": false, 
                    "size": 20, 
                    "sticky": false
                }, 
                {
                    "font": "Arial", 
                    "media": [], 
                    "name": "Back", 
                    "ord": 1, 
                    "rtl": false, 
                    "size": 20, 
                    "sticky": false
                }
            ], 
            "latexPost": "\\end{document}", 
            "latexPre": "\\documentclass[12pt]{article}\n\\special{papersize=3in,5in}\n\\usepackage[utf8]{inputenc}\n\\usepackage{amssymb,amsmath}\n\\pagestyle{empty}\n\\setlength{\\parindent}{0in}\n\\begin{document}\n", 
            "name": "Basic-cef25", 
            "req": [
                [
                    0, 
                    "all", 
                    [
                        0
                    ]
                ]
            ], 
            "sortf": 0, 
            "tags": [], 
            "tmpls": [
                {
                    "afmt": "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}", 
                    "bafmt": "", 
                    "bfont": "Arial", 
                    "bqfmt": "", 
                    "bsize": 12, 
                    "did": null, 
                    "name": "Card 1", 
                    "ord": 0, 
                    "qfmt": "{{Front}}"
                }
            ], 
            "type": 0, 
            "vers": []
        }
/* A note. */
        {
            "__type__": "Note", 
            "data": "", 
            "fields": [
                "the", 
                "[sound:ankidroid_audiorec-2010477767.3gp]"
            ], 
            "flags": 0, 
            "guid": "PpaY6", 
            "note_model_uuid": "38364ac0-79af-11e8-b58c-40f02f569107", 
            "tags": [
                "marked"
            ]
        }
NiloCK commented 6 years ago

Waiting on #29 so that media-attachments will be transferable.