Markdown2Anki
Markdown2Anki copied to clipboard
Adding metadata to markdown input files
When using markdown2Anki, users are likely to create different notes for different decks or note types. This would, in practice, make it possible to define "note types" inside of markdown files, making the creation process closer to what Anki's editor allows you to do.
It would be nice if some metadata could be added as frontmatter in the MD input files (YAML), as to specify the deck, note type (also easily allowing users to specify if clozes are type-in or blanks) and tags.
The frontmatter should persist when the users clear the file, so that they don't have to fill them back in.
This would also make it much easier to implement a direct connection to Anki to send the cards without having to use CSV files.
Steps:
- Read frontmatter and turn it into a nice dictionary (also add a type signature for it)
- Have "clear file" keep frontmatter [The next steps have to be implemented after the AnkiConnect API integration]
- Add validation for the decks and the note-type (basic and cloze) metadata, raising errors if they aren't present