-
Notifications
You must be signed in to change notification settings - Fork 146
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
Regex: Flashcards from native callout blocks (admonitions) #332
Comments
I'm glad you like it.
|
That was very helpful. Thank you. |
Thank you, GBergatto, great work! |
I wonder if someone has implemented this using the obsidian-admonition plugin. In my opinion it would make cards much easier to type and the markdown would be cleaner. |
Awesome regex!!! Thanks for save my time to find solution to integrate obsidian callout and anki flashcard :3 |
Thanks for this @GBergatto. Images can be used? |
Yes, you can add images too. You simply need to embed them into the body of the callout block
|
@SubZeroX Anyway, I don't think that it changes the way the content is displayed inside Anki, or does it? |
Yep, it don't changes the behavior at all. In order to show the html in Anki you need to type the combo "CTRL+SHIFT+X". Much appreciated for your answers |
Has anyone tried to get the callout information when it has a description or not? I tried but was not successful. Example 1 - Many line descriptionCallout
Anki Fields Example 2 - One line descriptionCallout
Anki Fields Example 3 - No descriptionCallout
Anki Fields |
Hi! I've started using your regex thaht mak my vaul much cleaner! Thanks for the job!!! |
@Davidb-2107 Yes, from the plugin settings All you need to do is choose which field should contain the "file link" and the plugin will take care of the rest |
Hey, no worries. In the main.js there should already be a function called format(...). You just have to replace the existing format function with the code snippet provided. Essentially, this just modifies the format function and adds the format callouts function. Does that help? |
I absolute love this Regex. It's even better than the common ones! I have been wondering: Is there a way to manually tag cards with this regex? If I append a "Tags: [Tag]", it doesn't register and only shows up as a text in the answer field. |
Hi GBergatto, thanks for the great work - i am using it a lot for my studies. Do you have a idea how to modify the regex for nested callouts or multiple callouts in one admonition? For example like this: `
This is not part of the flashcard as it's separated by a blank line. |
@daelen-j I'm not sure what you mean. FYI I have stopped using this plugin and this regex, so I'm not sure I will be able to test any changes to the original regex I posted. |
@GBergatto Can you kindly tell me what you currently use? Which plugin and what workflow are you following? I'd really appreciate that. Thanks :) |
@aadimator I created a private fork of flashcards-obsidian from which I stripped all the features I don't need to keep it as simple as possible. Since most of the time I don't want to keep the content of a flashcard in the Obsidian note that generated it, my version of the plugin removes the lines that generated the flashcard from the markdown file after having added it to Anki. The syntax for a flashcard is simply
|
This regex creates a flashcards from callout blocks, that are now native to Obsidian as of v0.14.0.
Regex line:
(?:\> \[!anki\]-) ([^\n]+)\n(.+(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)
To make it more specific, the regex will only match a callout block that start with
> [!anki]-
.This allows you to keep using all defaults callout blocks without any issues.
Example
Why this regex?
I see this regex as a replacement for the Markdown table style. The goal is the same: it looks nice when rendered in the Preview view of Obsidian.
The benefits over the markdown table are:
The text was updated successfully, but these errors were encountered: