jomaway / typst-gentle-clues

Simple admonishment for typst
MIT License
25 stars 5 forks source link

Please decouple `linguify` #9

Closed ivaquero closed 3 months ago

ivaquero commented 3 months ago

The new release can't read my local lang.toml, I'm sure it's caused by linguify:0.3.0 that force me to use the package's lang.toml.

image

Could you please decouple linguify? I am not sure if it's against your design, however, I think fewer dependencies makes this package more flexible.

jomaway commented 3 months ago

How did you load your lang.toml? Did you use linguify_set_databse(toml(your_lang.toml)) ?

Another option is to use linguify_add_to_database()

ivaquero commented 3 months ago

Yes, I tried both of the functions, but get the same error. I guess I need to wait for a newer release.

jomaway commented 3 months ago

Can you send me your lang.toml file then i can run some test later tonight.

ivaquero commented 3 months ago

Sure.

default-lang = "zh"

[en]
font = "Arial"
chapter = "Chapter"
content = "Content"
definition = "Definition"
theorem = "Theorem"
lemma = "Lemma"
corollary = "Corollary"
algorithm = "Algorithm"
alert = "Alert"
tip = "Tip"
eq = " Eq."

[zh]
font = "Songti SC"
chapter = "章节"
content = "主要内容"
definition = "定义"
theorem = "定理"
lemma = "引理"
corollary = "推论"
algorithm = "算法"
alert = "注意"
tip = "提示"
eq = "  式 "
ivaquero commented 3 months ago

BTW, version 0.6.0 works fine.

jomaway commented 3 months ago

yes i know, linguify is a project which evolved out of gentle-clues. So i thought i extract it but i haven't thought about that it will affect if more than one package is using linguify. So there are two options.

ivaquero commented 3 months ago

linguify is a great package, because of it, I started to follow you, and then found gentle-clue.

In my experience, I think the 1st option fits more cases. But, I agree that the 2nd one is feasible if you make linguify a soft dependency.

jomaway commented 3 months ago

Thanks, i will try to resolve this a soon as possible. What you could try as a workaround is to copy the sections from gentle-clues lang.toml into your lang.toml if this works. Otherwise i guess it is the best to stay with version 0.6.0 until this is fixed.

jomaway commented 3 months ago

The issue should be resolved in the version 0.7.1

ivaquero commented 3 months ago

I tested, it works. Thank you for your efforts.