Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding metadata to markdown input files #11

Open
Mochitto opened this issue May 29, 2023 · 1 comment · May be fixed by #28
Open

Adding metadata to markdown input files #11

Mochitto opened this issue May 29, 2023 · 1 comment · May be fixed by #28
Assignees
Labels
enhancement New feature or request

Comments

@Mochitto
Copy link
Owner

Mochitto commented May 29, 2023

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
@MarkoSagadin
Copy link
Collaborator

MarkoSagadin commented Oct 17, 2024

That doesn't seem too hard to implement.

What should the required fields be here?

Maybe "deck_name" and "note_type? Or just "Deck" and "Note Type" to match the Anki's use?

Are there any others?

MarkoSagadin added a commit to MarkoSagadin/Markdown2Anki that referenced this issue Feb 16, 2025
It is now expected that every markdown document contains frontmatter
block with three required fields:
- deck_name,
- note_type_basic and
- note_type_clozes

tags and no_tabs fields are optional. Currently only no_tabs field is
actually used.

Closes: Mochitto#11
MarkoSagadin added a commit to MarkoSagadin/Markdown2Anki that referenced this issue Feb 16, 2025
It is now expected that every markdown document contains frontmatter
block with three required fields:
- deck_name,
- note_type_basic and
- note_type_clozes

tags and no_tabs fields are optional. Currently only no_tabs field is
actually used.

Closes: Mochitto#11
@MarkoSagadin MarkoSagadin linked a pull request Feb 22, 2025 that will close this issue
MarkoSagadin added a commit to MarkoSagadin/Markdown2Anki that referenced this issue Feb 27, 2025
It is now expected that every markdown document contains frontmatter
block with three required fields:
- deck_name,
- note_type_basic and
- note_type_clozes

tags and no_tabs fields are optional. Currently only no_tabs field is
actually used.

Closes: Mochitto#11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants