fonol / anki-search-inside-add-card

An add-on providing full-text-search and PDF reading functionality to Anki's Add card dialog
https://ankiweb.net/shared/info/1781298089
GNU Affero General Public License v3.0
178 stars 24 forks source link

Not an issue, but a question. #168

Open dummifiedme opened 3 years ago

dummifiedme commented 3 years ago

What is the use of the "New Note" option? How can I use it effectively? Till now I only used it for imopting a PDF and writing some small two-liners about the PDF. But it seems to me, there must be something more to it.

I am talking about this window: image

PS: Thanks for this ADD-ON! 💯

dummifiedme commented 3 years ago

Edit: So I explored it a bit more, and found a very interesting thing! It imports websites as markdown! Which is great! But I don't see any way to create cards from those markdown notes (other than copy paste). Is it something that is present and I couldn't find, or is it missing altogether?

In any case, please take some time out and tell me a bit about the usage of notes in your workflow.

Also,

Where are these markdowns stored? Can they be saved as .md in a particular directory?

Because then, it can be an awesome way to add and create notes as well as anki, and I can call obsidian into picture (needs just a folder and markdown files).

fonol commented 3 years ago

The notes are different from Anki's notes, there is no concept of cards. They are not meant to be included in the SRS process in any way, they are rather like containers for the content you process in the add-on. You can use them how you like, either with textual content for reading (e.g. content from a Wikipedia article), or as PDFs or Youtube videos (by setting the source to either a PDF file path or a Youtube URL).

The notes and their content (like all content of this add-on) are stored in an SQLite database (like Anki's data too).

dummifiedme commented 3 years ago

Oh, I see. Wouldn't it be great if we can use the notes or the text extracted from a website to capture Anki Notes? Just like we do from the pdf's?

Let's say, I have a website or an article to make notes from, I can keep it as a note, and make anki off it while having the context just like with the pdfs and videos.

It might not be appealing but it seems very promising.

Also, is there a compulsion for you to store the notes in a db? (not the anki notes, but the notes).

I am asking it because a lot of people keep their notes in markdown format, and making cards off it could be a boon!

If its not too much, can we have markdown (the notes dialog) to cards functionality? (request, I know you have already done enough :))

Big fan.

fonol commented 3 years ago

Yea porting some of the PDFs functionality (searching on select, clozing, showing created cards in the sidebar) to the textual notes / Youtube notes is on the agenda, but as it will probably be quite some work, I cannot really tell when I will do that.

Storing the notes in a database allows for easy searching, fast updating etc.

If its not too much, can we have markdown (the notes dialog) to cards functionality?

Can you elaborate? Do you mean like setting the source of an add-on note to sth like "path/to/file.md" and when you open the note in the reader, it will show the markdown?

dummifiedme commented 3 years ago

Okay, so I think I was not clear enough in the previous messages. I will try to break the idea and be more elaborate. There are a few things, I will list them out.

  1. Making or capturing a note (markdown)

    • already present in the system. We can type out markdown in the Note Dialog or capture a website as markdown.
  2. Notes in point 1 could be accesssed or saved in a directory

    • .md files that could be stored inside a directory. To be accessed or edited outside.
  3. Notes to Cards (Independent of POINT 2)

    • The notes in point 1 could be used to make cards just like we make in a pdf. Same thing and options ported to these notes.

    • As I saw, the notes are opened in the exact same way as a pdf. But the options to highlight, cloze on select or send to field etc are missing.

    • I understand that the highlights are not possible and not required either, but it other card making options can be really helpful for making cards out of a website

      • or simply a markdown note typed in the ADD-ON,
        • or if point 2 is implementable, then virually any MD file!!.
  4. If all the above points are implemented, then you have a complete solution. One can just take note anywhere in a text file (single or multiple) or in a system like OBSIDIAN (linked individual markdown files) and still be able to make contextual ANKI cards.

Eg.

Regarding Database use:

If there's something not clear, let me know. :)

fonol commented 3 years ago

Okay, I think I get it now. The thing with the markdown files, it might have some advantage for Obsidian users/markdown note-takers. I could imagine adding the functionality to open notes with an .md file as their source in the markdown editor, as this wouldn't be much work, but again, no estimates, it is a feature I myself don't need. Next update will have the sidebar with added Anki notes for markdown notes too btw.

dummifiedme commented 3 years ago

Yes, I think adding a note as source file could work as well. And it would be much easier for both you and the person with a collection of notes, since there wouldn't be any clutter of files generated by the add-on.

p4nix commented 3 years ago

Is there any realistic chance of quickly getting those markdown files also searchable? Also, I'm not sure if SimpleMDE is really the best markdown editor for this use case, as I think I didn't see any more specialised abilities, for instance for MathJax.

fonol commented 3 years ago

To make them searchable, one would have to:

  1. collect all notes that have a .md source at index time (on add-on startup)
  2. read the file contents of all these files, and append this content to the default content that is indexed for the given note (title + text and source)

So far, not really hard, but I got two concerns:

  1. Index time might go up. I don't know how many .md files a typical obsidian folder contains, but if these are in the hundreds or even thousands at some point, that's a lot of disk I/O operations. Might be that this is a non-issue though, cannot really tell without trying out.
  2. At the moment, most of the time on add-on startup, the index is not rebuild from scratch. As the add-on is the only way to change a note's contents, it can reliably tell if something has changed or not. External .md files might have been changed from outside though, so there are only two options:
    • reindex on every add-on startup
    • treat .md notes as if they were unchanged, and let the user hit "Rebuild Index" manually

Concerning SimpleMDE and MathJax: https://gist.github.com/chooco13/c280c1cc6584c97af85307028ecaebb1

dummifiedme commented 3 years ago

As far as I know, the number of MD files go large as the people mostly follow atomic notes principle. Small notes for every topic. Though the content of the file might not be too much, the sheer number could be large. In thousands pretty soon.

I don't know much programming, but from what I can think of, we can have something like a scan of files that were modified or created since the last Anki-Addon run plus a rebuild button/option for manually reindexing.

There is another fact at play, adding each and every file as a source separately might become a hassle since there must be hundreds of files, with varying name and length of file names (unique though). It would be hard to remember on which notes I have Anki, and which I don't.

That is why I had suggested to catch a directory all together and mark the 'read' or 'percent read' kind of a thing on those files.

I don't really know how to implement it, it might be a difficult thing to manage inside the add on and might even fill it with 1000s of 'Source notes'.

p4nix commented 3 years ago

@dummifiedme have you considered rather linking to your Obsidian files with the Obsidian links (either manually, or with Obsidian To Anki?) So far, this is what I use as strategy to get prompts for writing in Obsidian. Otherwise, most of the material I learn is usually in PDF form anyway. For dissecting phrases (extracts in Supermemo), I use a special note type with the copied text and a couple of fields for custom javascript clozes.

dummifiedme commented 3 years ago

I do use obsidian 2 Anki script. And when I read pdfs, I use SIAC. Only thing is, the both things get confusing to keep. Some notes here and some notes there.

SIAC is definitely faster way to get your cards made from PDF, but I loose my linking with notes from other sources on the same topic. Obsidian allows me to keep adding stuff from various sources.. but if I send notes to Anki, I can't read the contextual things.

My topics are varied and require large text to be able to form answers. So, I can't put everything into Anki. Keeping the cards short is a problem for me. For facts it's okay, but for reasons and cause kind of a structure, it would make my cards go long. There I require tools like obsidian, where I can keep my notes and it links with other fats and data found somewhere else or in different subject altogether. I hope I am clear.

I used to make my notes entirely on Anki, it as my deck grew to over 4K cards, it began to show the problems. I wasn't able to properly revise my content as it wasn't at one place. If I make notes at two places, I would keep having these problems.

Currently, I am trying to use both, reading in SIAC to directly make small facts card using cloze and keeping a notepad (MD file) open to keep jotting points of a topic. That way, I can have facts inside Anki, while long form notes aside for comprehensive review. (I know it goes away from the principle of SRS and active recall, but the questions I will be getting in exams are really very long answer type - 250 words per question, mostly non technical).

Again, I hope I am clear.