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

Request and an idea for better cloze #198

Open
dummifiedme opened this issue Jan 9, 2021 · 11 comments
Open

Request and an idea for better cloze #198

dummifiedme opened this issue Jan 9, 2021 · 11 comments

Comments

@dummifiedme
Copy link

@dummifiedme dummifiedme commented Jan 9, 2021

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.

@problemadder
Copy link

@problemadder problemadder commented Jan 17, 2021

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

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 17, 2021

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

@problemadder
Copy link

@problemadder problemadder commented Jan 18, 2021

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

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 18, 2021

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

@problemadder
Copy link

@problemadder problemadder commented Jan 18, 2021

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

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 19, 2021

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

@problemadder
Copy link

@problemadder problemadder commented Jan 19, 2021

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

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 19, 2021

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.

@problemadder
Copy link

@problemadder problemadder commented Jan 19, 2021

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

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 19, 2021

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.

@problemadder
Copy link

@problemadder problemadder commented Jan 19, 2021

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

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

Successfully merging a pull request may close this issue.

None yet
2 participants