Cloze default open, cloze toggle and default close on flashcard view

I’ve been having issues documenting both for cards and for writing normally.
At times ill integrate cards into the text. The issues come when I’m reviewing the text and then there are clozes that I have to open to do a review reading, but I still want them to be testable content for the flashcards.

My request would be for the:

  • default behavior of clozes to be always open during regular reading
    or have a toggle to flip the default behavior of clozes
  • for the clozes to auto-hide on flashcard reviews

To phrase what (I think) is the same request slightly differently:

Logseq’s integration flashcards into notes themselves makes it an ideal medium for building a single (i.e. DRY) authoritative personal reference resource around a topic that can be accessed via multiple avenues:

  1. Spaced repetition review
  2. Explicitly pulling up the reference note when you need it.

A common example of this use-case for me would be references notes for a particular technical tool or language, such as regular expressions (regex).

From peeking at the DOM, it appears this is not something that could be solved with CSS, as collapsed clozes are represented as a single <a class="cloze">[...]</a> element.

I am moderately motivated to solve this issue myself, but have no experience with Logseq plugins. Does anyone have any recommendations for how to approach this problem?

1 Like

Found the area to flip the behavior. I just need to make sure it still inverts in the flashcard context and then add a user setting variable to attach to this. (Will take a while, first time with Clojure)
Image at the bottom

I’m not sure how to approach it with plugins. I see a push state function, that maybe could update the cloze state, but idk if that’s a real thing. I’ve only seen update state used to update pages.

Here are the docs for the Plugin API
https://plugins-doc.logseq.com/
Also here is a video demonstration from logseq
https://www.youtube.com/watch?v=57h7te3NvJg&t=3799s
and the repo of example plugins
https://github.com/logseq/logseq-plugin-samples