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

Fixes creating multipne cards-deck lines for newly created cards #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

putzwasser
Copy link
Contributor

Currently, if you add a new flash card and import it to anki, then flashcards-obsidian adds a new frontmatter line of

cards-deck: ${yourCardsDeckName}

to you file, which is unnecessary and annoying.

This tries to fix the creation of multiple cards-deck YAML/frontmatter lines during the process of adding new flash cards to anki.

This is more like a hotfix as I'm not sure if it solves the problem bug completely (or might lead to other problems).

This tries to fix the creation of multiple `cards-deck` YAML/frontmatter lines during the process of adding new flash cards to anki.

This is more like a hotfix as I'm not sure if it solves the problem bug completely.
@bytewife
Copy link
Contributor

Hey @putzwasser,

I'm not sure I quite understand this change. You're saying you are having multiple cards-deck frontmatter fields added when generating a card, right? I'm unable to reproduce this bug. Could you provide an example where this bug occurs?

@putzwasser
Copy link
Contributor Author

See this screencast (with spelling error 😉 )

screencast.webm

This happens every time a new card, i.e. new anki ID, is added to anki.

You can tell this behaviour from the updateFrontmatter function itself. It just checks if the frontmatter string is set. If so, add the cards-deck line, if not add a whole new/inital fontmatter block and add a cards-deck line there.

@bytewife
Copy link
Contributor

I see. Yeah I can reproduce this error. However, the PR does not appear to fix the issue. Could you look into this?

@bytewife
Copy link
Contributor

Also, could you link this PR to an Issue? Thank you!

@putzwasser
Copy link
Contributor Author

putzwasser commented Oct 22, 2022

However, the PR does not appear to fix the issue. Could you look into this?

Unfortunately, I can't as it fixed it for me.

Also, could you link this PR to an Issue? Thank you!

There's none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants