Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Flashcards are not added, even though I don't have any errors in Obsidian Console #201

Closed
Cloufish opened this issue Dec 31, 2023 · 12 comments

Comments

@Cloufish
Copy link

Cloufish commented Dec 31, 2023

Flashcards are not added, even though I don't have any errors in Obsidian Console
Just to be clear, I didn't installed your version/fork of the plugin - Is it possible to do that from Obsidian GUI?

I use a specific regex expression:
((?:[^\n][\n]?)+) #flashcard ?\n*((?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))+)
That is defined in the original documentation

However, when I run the plugin some Flashcards are created, and some not

  1. I checked regex expression and two of them (all tested) match the expression
  2. I use Basic Flashcard Type, and the Fields are being detected
  3. I have around 400 flashcards in my file, but only 290 are being created
  4. I cleared every setting from the menu—but this didn't help.
  5. I've set allowDuplicate: true in main.js in .obsidian/plugins/obsidian-to-anki-plugin folder
  6. Each flashcard has at least 2 new line characters

image
image

@ShootingKing-AM
Copy link
Owner

Share the Obsidian file also, whos cards are not added. Also the file for which the cards are added.

Share your anki showing the cards which are added and show that some cards are not added.

@Cloufish
Copy link
Author

Cloufish commented Dec 31, 2023

Unfortunately I can't give you a whole file. It contains confidential information
It's also in Polish

But I can give you the selected ones.

The ones not added:

Czy można zamieniać drukarki fiskalne? #flashcard 
- Nie


Co gdy drukarka wciąga/zacina papier #flashcard 
1. Poproszenie o zdjęcie rolki papieru, drukarki
2. OnSite 

The ones added:

Jak zmienić SLA? #flashcard 
- W zgłoszeniu Różne -> Pola dodatkowe
<!--ID: 1704043474821-->


Co jeśli monitor jest "Not Logged"? #flashcard 
- Należy ustawić auto-logowanie na MultiPoint Managerze
<!--ID: 1704043474392-->

image

image

image
image

@ShootingKing-AM
Copy link
Owner

Can you check regex for both ones, if its matching ? from regex101 site. With the original file ?

image

@Cloufish
Copy link
Author

I've checked the whole file

Many of my cards didn't have #flashcard hashtag. Around 10
I fixed them and they appeared.

But there are plenty of other cards that were not added
Each of them matches the Regex expression from the website

@ShootingKing-AM
Copy link
Owner

ShootingKing-AM commented Jan 1, 2024

On my side its working.
image
image

You can try making a small obsidian file and paste those which are not being added for test. or send me the whole file so that i can try to reproduce on my end.

@Cloufish
Copy link
Author

Cloufish commented Jan 1, 2024

Yeah,

Doing it and dividing this huge file into 8 smaller ones fixes the issue, and adds the remaining 200 flashcards

But this solution doesn't satisfy me :/
I thought that I could manage one file to create Anki Flashcards.
And now I have 8 of the files I need to manage, fix

@Cloufish Cloufish closed this as completed Jan 1, 2024
@ShootingKing-AM
Copy link
Owner

Thats not a solution, but to solve it properly you need to provide more information.

Atleast not the content, how big is the file ? Its size and content length ?

@Cloufish
Copy link
Author

Cloufish commented Jan 4, 2024

It has 12506 words
85477 characters
8,8Kb

@Cloufish Cloufish reopened this Jan 4, 2024
@basti-who
Copy link

basti-who commented Jan 5, 2024

Hi, I have the same issues with my regex. I'm using a dedicated callout since a few years:

> [!Anki] What are the ten Azure Cloud Shell Features?
> - Is temporary and requires a new or existing Azure Files share to be mounted.
> - Offers an integrated graphical text editor based on the open-source Monaco Editor.
> - Authenticates automatically for instant access to your resources.
> - Runs on a temporary host provided on a per-session, per-user basis.
> - Times out after 20 minutes without interactive activity.
> - Requires a resource group, storage account, and Azure File share.
> - Uses the same Azure file share for both Bash and PowerShell.
> - Is assigned to one machine per user account.
> - Persists $HOME using a 5-GB image held in your file share.
> - Permissions are set as a regular Linux user in Bash.
<!--ID: 1704376921158-->


> [!Anki] What do you need for Azure Cloud Shell?
> Azure subscription for Azure file share with monthly costs
> ![[20240104092224.png]]


> [!Anki] How to install all Azure Powershell Modules for current user?
> ```powershell
> Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
> ```


> [!Anki] How to update Azure Powershell Modules?
> ```powershell
> Update-Module -Name Az -Force
> ```


> [!Anki] How to get properties of created disk `$diskName` in Az Powershell?
> ```powershell
> Get-AzDisk -ResourceGroupName $resName -DiskName $diskName
> ``` 
<!--ID: 1704376921167-->

For some of my cards it works for some not and I do not see a pattern... This is my regex which I use for a few years now (stopped creating cards about a year ago...)

(?:> [!Anki]) ([^\n]+)\n(.+(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).)))

@basti-who
Copy link

basti-who commented Jan 5, 2024

I've also splitted my file into smaller pieces and can confirm that this fixed my issues for the small files with not more than 13 cards to add. In my main file where 31 cards needs to be added 19 in the middle are missing. All caches have been cleared before.

@ShootingKing-AM
Copy link
Owner

whats the size of your note ? Character length, Can you upload your whole note file @basti-who

@basti-who
Copy link

anki_withIDs.md
anki_withoutIDs.md

Both are really small with around 6KB. I've cleaned up one of them (anki_withoutIDs) so you can use it for debugging. After the clean up I've tried to run it again (to be added on a different deck in Anki) and the result can be seen in anki_withIDs.md. I'm using the Basic Notetype (Back, Front) with the regex:

(?:\> \[!Anki\]) ([^\n]+)\n(.+(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)

Repository owner locked and limited conversation to collaborators Jan 19, 2024
@ShootingKing-AM ShootingKing-AM closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants