Obsidian_to_Anki icon indicating copy to clipboard operation
Obsidian_to_Anki copied to clipboard

Request and an idea for better cloze

Open dummifiedme opened this issue 4 years ago • 11 comments

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.

dummifiedme avatar Jan 09 '21 16:01 dummifiedme

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

problemadder avatar Jan 17 '21 22:01 problemadder

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. 😁

dummifiedme avatar Jan 17 '21 23:01 dummifiedme

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}(?<!<!--).))*))

problemadder avatar Jan 18 '21 14:01 problemadder

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

dummifiedme avatar Jan 18 '21 17:01 dummifiedme

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. '''

problemadder avatar Jan 18 '21 20:01 problemadder

Yes. Sure. anyway, the idea of using footnotes as cloze hints would still be awesome, isn't it?

dummifiedme avatar Jan 19 '21 03:01 dummifiedme

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. '''

{{#Hint}}{{hint:Hint}}{{/Hint}}

''' Screenshot 2021-01-19 at 08 17 51

Screenshot 2021-01-19 at 08 18 00 Screenshot 2021-01-19 at 08 18 09

problemadder avatar Jan 19 '21 07:01 problemadder

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.

dummifiedme avatar Jan 19 '21 13:01 dummifiedme

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: front Back of card: back

problemadder avatar Jan 19 '21 14:01 problemadder

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.

dummifiedme avatar Jan 19 '21 16:01 dummifiedme

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).

problemadder avatar Jan 19 '21 16:01 problemadder