anki-apkg
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

anki-apkg

anki-apkg is highly inspired by anki-apkg-export and works almost the same, then why a new package?

Because I'm not satisfied with only creating {{front}} and {{back}} field for a card, this package is created to make it possible to customize fields (and any other variables of a deck or card in the future).

npm install anki-apkg
const { APKG } = require('anki-apkg')
 
const apkg = new APKG({
    name: 'VocabularyBuilder',
    card: {
        fields: ['word', 'meaning', 'usage'],
        template: {
            question: '{{word}}',
            answer: `
              <div class="word">{{word}}</div>
              <div class="meaning">{{meaning}}</div>
              <div class="usage">{{usage}}</div>
            `
        },
        styleText: '.card { text-align: center; }'
    }
})
apkg.addCard({
    timestamp: +new Date(), // create time
    content: ['sample word', 'sample meaning', 'sample usage'] // keep the order same as `fields` defined above
})
apkg.save(__dirname)

TODO

  • media

Readme

Keywords

none

Package Sidebar

Install

npm i anki-apkg

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

87.4 kB

Total Files

10

Last publish

Collaborators

  • ndyag