reuseman / flashcards-obsidian

🎴 An Anki plugin for Obsidian.md
MIT License
897 stars 87 forks source link

Allow alternative symbols (e.g. double colon) to avoid conflict with other plug-ins that use the same symbols #61

Closed ianscottknight closed 2 years ago

ianscottknight commented 2 years ago

I use the dataview plug-in which already utilizes double-colon to allow in-line setting of YAML values. Whenever I try to generate flashcards for a given file with in-line YAML, the flashcards plug-in treats the in-line YAML as a question:answer setting. Basically, the flashcards plug-in and dataview plug-in use the same symbol, so it would be nice to be able to set alternative symbol in the plug-in settings.

I found a hack of sorts, in that I place all of the keys for my in-line YAML within backticks (e.g. year: 2013), which causes the flashcards plug-in to fail to add such lines as cards for some reason. It's fine for my purposes, but it is brittle. I would love to see alternative symbols allowed to avoid this conflict in the first place.

github-actions[bot] commented 2 years ago

Thank you for taking the time to report the issue and help me to make the project better! 🙂

marvinwu commented 2 years ago

+1 for this, :: is quite common especially in code, another way could be provide option to disable inline cards

phillipjohnston commented 2 years ago

Happening to me as well, in both places: code snippets and with dataview annotations.

phillipjohnston commented 2 years ago

Another solution I would be willing to use given my current difficulties would even be a simple toggle to turn off the inline format (e.g., disable :: parsing altogether). Unfortunately backticks don't seem to work for me as a workaround.

Edit: whoops, I see now that marvinwu beat me to it!)

GrumpyTuna commented 2 years ago

+1 also. Same conflictive issue with dataview (and the resulting creation of unintended cards).

Anyway, great work with this plugin (using it almost daily!)

reuseman commented 2 years ago

So @GrumpyTuna, @phillipjohnston, @marvinwu, @ianscottknight what do you think it's the best choice? Turn off the option could be useful, but I think it's more appropriate to have different characters. Or if you can describe to me how you use data view annotations, maybe we can come up with a better solution.

Is it used in some block like this?

```dataview
option::something
... and so on

If that's the case, then one option could be just to check whether the inline card is in a block or not.

GrumpyTuna commented 2 years ago

Latest update of dataview don't ask inlines to be in a block (only needed if you are doing a query). The best option, I think, is to have completely different characters.

Thanks!!!!

ianscottknight commented 2 years ago

I agree with @GrumpyTuna. I think the best option is to allow users to define their own characters in the plug-in configuration.

Narsail commented 2 years ago

Or to provide an option what character you want to use for inline.

nihitkhandelwal-eng commented 2 years ago

How about ">>" or "→" ?

reuseman commented 2 years ago

Now you have the possibility to use custom symbols

phillipjohnston commented 2 years ago

Thank you!

GrumpyTuna commented 2 years ago

great!