-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Request: conform to XDG basedir spec #876
Comments
If you really care about it, you can use tealdeer, which adheres to the XDG BaseDir spec. Take note that it is written in Rust, so you'll need a Rust compiler installed to build it. Disclaimer, I'm a contributor to the project. |
@SShrike and @jasonkarns, this is something we might include in the client spec that is being defined at #1065. Please comment there if you think it should be enforced for all clients, or not. |
My cache files still get written to my home directory on macOS. Any tips? |
@sebdanielsson do you mean the tldr cache where the pages are stored? If so, you can open an issue about this at your client's repository or use another client. |
Looks like this issue belongs to this repo: There's already an issue for it: Sorry for the inconvenience. |
About the configuration fileContinuing https://github.com/orgs/tldr-pages/discussions/10796 Note: The standardization about the configuration file location could be applied to the cache or data directory as well. Before
AfterThe specification should define a standard file format and location for a user configuration file. As the official clients are cross-platforms, they should read from the standard configuration folder for each platform:
Reference
ExamplesExamples of project doing that: Fire formatThen the file format could be selected among YAML, JSON, TOML depending on what kind of libraries is most robust, natively included, etc. in the different languages of the official clients. (PS: TOML is just some kind of standardized INI). |
I am not sure I am convinced about having a unified configuration file that is detailed in the client spec. Different programming languages tend to use their own file format (Javascript would probably use JSON, Rust programs tend to prefer toml), so there isn't really one format that fits all. Allowing different formats and having clients check multiple files seems overly complicated to me. Additionally, if some clients have more options than others, all clients would have to explicitly ignore options they don't understand, which in turn makes it harder to debug a faulty config (for example a typo I think that recommending something like "stick to XDG or similar convention" sounds good, but a unified |
There are 3 different things about the config:
|
Hm, I must say, I don't think I agree with "Unifying a minimal set of keys". Some options have natural derivations from the CLI specification, but I wouldn't force anyone to implement a mapping to a config file in any particular way. I think the most that could be required from clients is to document how CLI args are mapped to configuration file options, for example by recommending that this can be found from |
I understand your point, however if there is not a minimal set of keys supported by all clients and a standard config file location, then it means the clients are not much interoperable and a user need to re-write a specific conf file when he change of tldr flavor. At least; if those points are not required in the spec, they could be suggested / being optional to nudge developers toward having a homogenous ecosystem without strictly enforcing anything. What do you think? |
The client spec tries to be accepting of all kinds of client, regardless of whether they are CLI-based or not. Perhaps some wording like it's RECOMMENDED to follow the appropriate per-platform standards for storing any configuration files.
It was never the goal to have clients be interoperable. I would argue that this is out-of-scope. If all clients do exactly the same thing, then why do we have multiple clients? The point of an ecosystem of clients is to allow every possible platform and combination to be supported. Not just CLI clients, but also Android, web, etc...... Ref XDG, does this even make sense on all platforms (e.g. Windows, Android, etc)? |
I am for closing this issue as not planned. sbrl's arguments convince me. Why should we tell the clients where to store their data? If this is an issue it should be raised in the bug tracker of the respective client |
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Presently, it is writing to
~/.tldrc
and is not respectingXDG_CONFIG_HOME
orXDG_CACHE_HOME
orXDG_DATA_HOME
. I'm not sure how much of the directory is config vs cache vs data, so I don't know which xdg directories it should be written to. But none of it should be in~
.The text was updated successfully, but these errors were encountered: