pjheslin / diogenes

Diogenes: an environment for reading Latin and Greek
https://d.iogen.es/d
Other
56 stars 10 forks source link

Add SilverDict integration #110

Open Crissium opened 10 months ago

Crissium commented 10 months ago

I am the developer of SilverDict, a web-based dictionary lookup tool that supports DSL, StarDict and MDict. Unlike GoldenDict, it exposes a lookup API (/api/query/<Group name>/<word>) that could be easily integrated into other programs, including Diogenes.

I have added a few lines in server/Diogenes/Perseus.pm beside the ones that create links pointing to the PDF Latin dictionaries. They create another link pointing to http://localhost:2628/api/query/Diogenes/$word, which when clicked, opens a pop-up window showing the definition. For this feature to work, users need to have a local SilverDict installation and create a dictionary group named 'Diogenes' with the languages el, la, and add relevant dictionaries. This feature has been tested on Linux desktop (with and without electron) and Android.

Screenshot

Edit: it might be better if the server address of SilverDict is configurable instead of hardcoded to localhost.

Crissium commented 5 months ago

I just committed a new change that replaced the link to the bare HTML article with a full SilverDict web interface, and now when opened the new window is placed at the bottom right corner.

Screenshot_2024-03-17_17-07-54

pjheslin commented 5 months ago

Thank you so much for working on this. I'm very sorry I never got back to you about in October; I had some personal issues. I am keen to test this functionality now!