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

(Re-)creating a deck from notes with given IDs seems to fail silently #621

Open
daniu54 opened this issue Oct 21, 2024 · 1 comment
Open

Comments

@daniu54
Copy link

daniu54 commented Oct 21, 2024

I have cards with given IDs and I would like to give them to my colleague. Unfortunately, it seems to not be possible to generate an Anki Deck from cards, which have IDs provided already.

This could also be a problem, if one deletes the deck locally and needs to regenerate it.
I have tried to clear the Media Cache and the File Hash Cache.

Or is this an intended feature?

@daniu54
Copy link
Author

daniu54 commented Oct 21, 2024

My current solution is to remove all IDs from the cards using the following script:

#!/bin/bash

# Use the current directory as the Obsidian vault directory
VAULT_DIR="$(pwd)"

echo "Removing Obsidian Anki IDs from markdown files at $VAULT_DIR"

# Use 'find' to locate all markdown files in current directory and subdirectories, then process each file
find "$VAULT_DIR" -type f -name "*.md" | while read -r file; do
  # Use 'sed' to delete lines containing the pattern <!--ID: number-->
  sed -i '/<!--ID: [0-9]\+-->/d' "$file"
done

echo "Finished removing IDs from markdown files."

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

No branches or pull requests

1 participant