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
421 stars 30 forks source link

enhance: add "On hover" style for rendering broken cloze macro #225

Closed e-zz closed 6 months ago

e-zz commented 7 months ago

on hover

Hi! Inspired by another plugin logseq-plugin-wrap , this PR

debanjandhar12 commented 6 months ago

Thanks for the contribution.

However, can you please incorporate a distinct setting for "showClozesOnHoverInAnki" instead of relying on the "renderAnkiClozeMarcosInLogseq" to determine whether to display clozes on hover?

The "renderAnkiClozeMarcosInLogseq" setting primarily addresses the rendering of formatting elements such as bold and italic in Logseq.


By default, the behavior should involve enclosing "c1," "c2" macros, etc., within a span with the "anki-cloze" class.

When "renderAnkiClozeMarcosInLogseq" is set to true, the line content = (await convertToHTMLFile(content, "markdown")).html; should be invoked.

In the case of "showClozesOnHoverInAnki" being true, a hover style for "anki-cloze" should be applied. Otherwise, the style ".anki-cloze {background-color:rgb(59 130 246 / 0.1);} should be added.

e-zz commented 6 months ago

Thanks for the contribution.

However, can you please incorporate a distinct setting for "showClozesOnHoverInAnki" instead of relying on the "renderAnkiClozeMarcosInLogseq" to determine whether to display clozes on hover?

The "renderAnkiClozeMarcosInLogseq" setting primarily addresses the rendering of formatting elements such as bold and italic in Logseq.

By default, the behavior should involve enclosing "c1," "c2" macros, etc., within a span with the "anki-cloze" class.

When "renderAnkiClozeMarcosInLogseq" is set to true, the line content = (await convertToHTMLFile(content, "markdown")).html; should be invoked.

In the case of "showClozesOnHoverInAnki" being true, a hover style for "anki-cloze" should be applied. Otherwise, the style ".anki-cloze {background-color:rgb(59 130 246 / 0.1);} should be added.

Hi, sorry I didn't realize the option is to control the rendering of markdown syntax. Now two seperate options are provided to control the way of cloze rendering.
Cheers!

debanjandhar12 commented 6 months ago

Thanks.

LGTM!