this post was submitted on 22 Oct 2023
1 points (100.0% liked)

Emacs

314 readers
2 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
top 7 comments
sorted by: hot top controversial new old
[–] Zinbiel@alien.top 1 points 1 year ago
[–] eli-qq@alien.top 1 points 1 year ago (1 children)

Hi, I found that we have the same idea. I recently wrote a similar package that

focuses on customizability and not modifying the original text. My idea is that

we should allow users to define which parts are the front side of the card,

which parts are the back side, which parts need to create an ID, and so on, so

my package focuses more on customizability. Additionally, I found that we both use org

emphases as the marker for cloze, which is really coincidental :) .

Here is my package: https://github.com/Elilif/emacs-anki-helper

[–] meedstrom@alien.top 1 points 1 year ago (2 children)

You beautiful bastard. Starred.

Yes, org emphasis makes it easy with the regexp org-emph-re :-)

From your source code, I infer that the note ID is saved in a property ANKI_NOTE_ID, which always goes in a property drawer, correct? Or did you find a way to skip recording the ID in some cases? Or detach property drawers from headlines?

[–] eli-qq@alien.top 1 points 1 year ago

I am learning french, too. I my case, I use item list to collect words, for instance:

^(- [ ] Oui)

^(- [ ] Non)

^(- [ ] Peut-être.)

In this case, I can sync all words without recording the ID.

[–] eli-qq@alien.top 1 points 1 year ago (1 children)

I infer that the note ID is saved in a property ANKI_NOTE_ID, which always goes in a property drawer, correct?

This is used for traditional card format, where one headline is one card.

Or did you find a way to skip recording the ID in some cases? Or detach property drawers from headlines?

It's all customizable, See card-that-are-not-entries and change-the-default-behavior

[–] meedstrom@alien.top 1 points 1 year ago (1 children)

I see anki-helper-request lets the user make their own AnkiConnect request, so I see it's totally customizable (for programmers). Which is a good idea, but I'm also interested in automating some default syntaxes. I'm curious how you personally would do it? Let's say you have note text that's open to change, and you still don't want a headline.

[–] eli-qq@alien.top 1 points 1 year ago

Let's say you have note text that's open to change, and you still don't want a headline.

I have thought of many ways to achieve this requirement, and one of them is similar to your solution: using explicit ID tags. My current approach is to use text properties and overlays. Every time I need to create a note, anki-helper will add the corresponding text properties and overlays to the original text (see the figure below). When I save the current file, anki-helper will also save the corresponding text properties. When I open this file again, anki-helper will add text properties and overlays to the string. This approach is still experimental, but I believe its advantage is that it does not modify the original text at all, while providing great flexibility.

In the following figure: "anki-card" at the end is an overlay indicating this paragraph is an anki note, and the whole paragraph has the three text properties, that lets me update/delete the note.

https://preview.redd.it/ex8x388x0vvb1.png?width=681&format=png&auto=webp&s=8b46f4acb4f880141b4e164eab0509658b698dab