Obsidian_to_Anki
Obsidian_to_Anki copied to clipboard
Request and an idea for better cloze
I like the way cloze are implemented using curly braces and highlights. Highlights do make the notes a lot nicer. Though for hints, we need to put in :: which will again be unnecessary in the preview. I thought maybe we can have something to make it nicer.
The idea
The idea is to use footnote syntax ^[hint] as the added hints.
The cloze will function as it is. Just adding an additional condition that if there is a cloze before footnote, append :: to the footnote and add it to the created cloze.
I don't know if it will be hard to implement. But it would really be a nice way to have cloze hints. We can discuss on it if someone wants to. And even discuss other ideas to have a better way.
Thanks.
Agree! Would be great. Already exists in Anki: input: "we have a pretty {{c1::daunting::entmutigend}} task in front of us" question: "we have a pretty entmutigend task in front of us" answer: "we have a pretty daunting task in front of us" would love this feature in obsidian_to_anki
This way is already there in ANKI and this script as well. You can use this way here from obsidian as well.
I am asking for a neat way, that's all. 😁
How? Obsidian: we have a pretty {{c1:daunting::entmutigend}} task in front of us
Anki: front: we have a pretty {{c1:daunting back: entmutigend}} task in front of us Any idea? (CurlyCloze enabled and regex ((?:.+\n)(?:.{.)(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).))*))
I used them randomly one day and they worked fine. That was like a month ago. I will check and get back,
And, I use curly clozes. I miostly did like this (below), before the arrival of Highlighted cloze.
we have a pretty {daunting::entmutigend} task in front of us
In highlighted cloze as well, I used them and it worked fine!
we have a pretty ==daunting::entmutigend== task in front of us
I found the problem. My "Basic" regex is Remnote Style (::). So I have to use this for the Cloze with two words: START Cloze we have a pretty {daunting::entmutigend} task in front of us END
''' Try to make sure your regex matches don't overlap with each other. The script is designed, however, to not recognise a match inside another match (for different note types).
For example, if you're using the default syntax of the script for the 'Cloze' note type:
START Cloze This is a {{c1::test}} END
, you don't have to worry about a RemNote single-line match being picked up. '''
Yes. Sure. anyway, the idea of using footnotes as cloze hints would still be awesome, isn't it?
It would be awesome! I have an idea for a workaround - your solution seems quite complicated. You could add an "anki field" named "Hint" with the obsidian footnote syntaxe (This would answer my question how to implement another field 😃 ) and then add this to your card template in anki (ankis build in hint feature). If you click on "hint" the hint is shown. '''
'''

You don't seem to understand what I am trying to say.
I am suggesting an alternative way to add hints to clozes.
Instead of {cloze::hint}, I am suggesting to use {cloze} ^[hint].
There can't be an anki workaround to what I am saying.
FYI I don't use the block syntax for cards. I use regex. And I just wanted clean way to have cards right from the notes.
i think this is a workaround. you can add a field in the Cloze Question like this. so you only have to add the "Hint" field via regex. if one is able to add any field in regex a cool readable solution would work. do i still get it wrong?
anki cards template:
{{cloze:Text}} <br> <br> <br> {{Hint}}
Front of Card:
Back of card:

I get the workaround, but it still won't be in the reading flow. Like if I need to cloze a year like 1984 and I need to tell that that field contains an year, I will have to place the term 'year' in the text somewhere, which would not go with the normal reading flow. And too obvious if read in the note, while if its in footer, it's not directly available while reading.
So, yes, we can have something like you suggest, and create regex for such field.
But still you are assuming that the text line has only one cloze :)
What if there's two? Then we well have to have both the hints together in that field.
i get your point and I would love to use your footnote approach if it ever comes to existence. i started a discussion Readability and regex and hope that more people come around with ideas like yours (and some who can build them).