debanjandhar12 / logseq-anki-sync

An logseq to anki syncing plugin with superpowers - image occlusion, card direction, incremental cards, and a lot more.
GNU Affero General Public License v3.0
465 stars 34 forks source link

enhance: specify cloze number by {{clozeID xxx}} #250

Closed e-zz closed 9 months ago

e-zz commented 10 months ago

This PR enables cloze syntax like {{cloze1 xxx}}, where the number after keyword cloze specifies the display order of the cloze. It works the same as {{c1 xxx}}.

Motivation: In logseq, the keyword for cloze macro is cloze, instead of c in anki style. So maybe it's reasonable to support also parsing clozeID syntax. For example, when one wants to force {{cloze a}} to appear in the 2nd card, there would be a slight advantage in modifying it to {{cloze2 a}} over {{c2 a}}.

e-zz commented 10 months ago

Thank you and sorry for late reply. I check it and found it is not working as expected.

When clicking sync button, note is not created from {{cloze1 ok}} as it does not get picked up by getNotesFromLogseqBlocks.

Hi, Thanks for the test. I have patched the PR and now getNotesFromLogseqBlocks works well with {{clozeID }} syntax. Cheers!

debanjandhar12 commented 9 months ago

Thanks.

LGTM!