pjheslin / diogenes

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

Feature Suggestion: relative paths when defining database locations in diogenes.prefs? #111

Open jiang-qian opened 7 months ago

jiang-qian commented 7 months ago

First of all, with the help of its developer I got Diogenes to run on iPadOS through a nice program called a-shell. And I assume it should run well on iOS devices as well. The performance is phenomenal, particularly when it comes to searching with complex terms, on my iPad with M1 chip and the convenience of browsing Diogenes offline one a large screened but still highly mobile device is transformative!

iOS and iPadOS has peculiar directory structure. Each app has its own private container and so the absolute path of a file within that app’s private container contains a long random number that defines the specific app and container. Even worse, when an app is updated, the random number also changes. This renders the absolute path of a home directory of the directory of Diogenes’s database files changing from time to time when a-shell gets updated!

Diogenes, when specifying the location of databases in Diogenes.prefs, accept only absolute path. It would be wonderful if the database location can be specified relative to $HOME directory environmental variable. This will obviate the problem of changing absolute path of the $HOME and will also make moving Diogenes installations between machines much easier!

Thank you for looking into this!

nitardus commented 4 months ago

When I forked the core Diogenes modules for my Lynkeus project, I added the option to set the database locations via environment variables. Since I have now forked diogenes itself, too (to fix some bugs, especially of its forgotten but excellent command line interface), I could add it as a feature there, too. Would that be of any help to you?

I have now added this option in my fork. Clone the repository git clone https://github.com/nitardus/diogenes cd diogenes download the morphological data make -f mk.prebuilt-data set the environment variable and start the server export TLG_DIR=$HOME/some/path/TLG/TLG_E export PHI_DIR=$HOME/some/path/PHI server/diogenes-server.pl

To make the environment variables last for future sessions, append to your ~/.profile: export TLG_DIR=$HOME/some/path/TLG/TLG_E export PHI_DIR=$HOME/some/path/PHI

jiang-qian commented 3 months ago

Thank you nitardus! This is indeed very helpful! I will try it out on my ipad soon! I have a few further feature suggestions about your fork of diogenes.

Indeed, as an enthusiastic student of Greek and Latin texts myself, I am quite interested your Lynkeus project as well. I installed it successfully on my Debian 12 but is at a loss about what it is for and how to use it. Would it be possible to reach you by email so that we don't clog this feature request of Diogenes with discussions unrelated to it?

If you don't mind I took the liberty of looking up your name (as shown on your github page) and found out your university web page. Would it be OK if I send an email to that address?

By the way, as a digital philologist, you might be interested interested another project I am very enthusiastic about, a modern and crossplatform dictionary shell (it runs on Android, iOS, Windows, Mac, Linux and Chromebook) https://github.com/Crissium/SilverDict

There are a large variety of dictionaries, many of special interests to classicists, that can be used with silverdict. For example here https://latin-dict.github.io/ and for ancient Greek Lexicons and Encyclopedia like Suda and Hesychius, you can find them here https://github.com/proteusx And there are many more if you're interested.

The developer made a pull request to integrate it with Diogenes https://github.com/pjheslin/diogenes/pull/110 He is a good friend of mine and if you're interested in collaborating with him we can all work together to make this better!

nitardus commented 3 months ago

Yes, absolutely, I would be more than happy to help! Thank you also for the links to SilverDict and the Dictionaries, which look really interesting, especially when they are connected to Diogenes...