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

FR: Use JSONs for Custom Dictionaries #108

Closed
chrisgrieser opened this issue Mar 31, 2022 · 14 comments
Closed

FR: Use JSONs for Custom Dictionaries #108

chrisgrieser opened this issue Mar 31, 2022 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@chrisgrieser
Copy link

I have encountered a few bugs with various plugins in Obsidian, which, as I could determine, was caused by having a large custom dictionary file (~3800 lines, ~425kb) in my vault:

it seems that Obsidian is simply having problems parsing large files, since it unsuccessfully searches for metadata in such a large file. the developer of the metadata extractor plugin suggested, that Various Complements should use JSON as a format for large custom dictionaries to avoid such problems, as well to increase performance Various complements as well as Obsidian in general.

@chrisgrieser chrisgrieser changed the title FR: Use JSONs as for Custom Dictionaries FR: Use JSONs for Custom Dictionaries Mar 31, 2022
@tadashi-aikawa
Copy link
Owner

Hi, @chrisgrieser.

I couldn't understand why using the JSON format could solve that problem. 🤔

the developer of the metadata extractor plugin suggested, that Various Complements should use JSON as a format for large custom dictionaries to avoid such problems

Could you tell me the link to the comment?

@kometenstaub
Copy link

kometenstaub commented Apr 1, 2022

Markdown files are scanned for metadata. It is not recommended to have content in markdown files that isn't markdown, because it trips up the parser and can make Obsidian slow. That has happened with XML files that had the md extension in the past, for example.
A JSON file (or any other non-markdown file) isn't taken into account by the metadata cache, so it can be in the vault without stalling Obsidian.
So it's not primarily about the JSON format, but rather the extension.

Additionally, using the JSON format should also make it easier to create data/have easier compatibility and can be very easily read and worked with in JavaScript.

@kometenstaub
Copy link

Plugins that use JSON are e.g. Obsidian Wordnet and Linked Data Vocabularies.

@tadashi-aikawa
Copy link
Owner

tadashi-aikawa commented Apr 1, 2022

@kometenstaub
Thank you for your explanation!

A JSON file (or any other non-markdown file) isn't taken into account by the metadata cache, so it can be in the vault without stalling Obsidian.

Good. I have the same understanding as you :)

Additionally, using the JSON format should also make it easier to create data/have easier compatibility and can be very easily read and worked with in JavaScript.

I adopted the textbase format because I gave priority to human readability/writability, JSON is a little redundant for humans, and some IME dictionary format supports the same. (Of course, it is better to support both formats)

@chrisgrieser
So, can you resolve the problem by using other extensions instead of .md ? (ex: .csv, .txt, ...)

@kometenstaub
Copy link

Yes, other extensions should work fine. txt seems to be a good candidate if you want to keep your format and parsing.

@chrisgrieser
Copy link
Author

yeah, txt would work!

I just tested adding a .txt as a custom dictionary, and it does seem to be recognized (number of items in the status bar increases), but the editor suggester does not appear for them.

@tadashi-aikawa
Copy link
Owner

It works.

image
image

@chrisgrieser
Copy link
Author

ah, my bad, haven't properly refresh the custom dictionaries 🙈

works!

@tadashi-aikawa tadashi-aikawa reopened this May 3, 2022
@tadashi-aikawa tadashi-aikawa self-assigned this May 3, 2022
@tadashi-aikawa tadashi-aikawa added the enhancement New feature or request label May 3, 2022
@tadashi-aikawa
Copy link
Owner

Related to #118

@tadashi-aikawa
Copy link
Owner

@tadashi-aikawa
Copy link
Owner

@chrisgrieser
I have released v6.1.0-beta4 🚀 If you share custom dictionaries with anyone, the new JSON format will be helpful :)

@chrisgrieser
Copy link
Author

by now I do not have the need for json custom dictionaries, since your other suggested solutions works just fine for me, sorry! 😅

@tadashi-aikawa
Copy link
Owner

Sure! I know 👍 That is merely sharing information 😄

@tadashi-aikawa
Copy link
Owner

Released v6.1.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants