Support command line options, especially for choosing a different wiki directory?
I think it would be convenient to be able to start the wiki using something like wikmd --dir /my/wikidir --conf myconfigfile.cfg
@johann-petrak, you can use environment variables to specify the wiki directory like this:
WIKI_DIRECTORY="~/.wikidata" wikmd
Currently, setting the config file via environment variables isn't supported. If that's a feature you'd like, feel free to create a PR to add it! You can check out the relevant code here: https://github.com/Linbreux/wikmd/blob/6d2c7457f47394696cbbf3433d78e8a193446a2e/src/wikmd/config.py#L75-L76
If you have any questions or run into issues, don't hesitate to reach out!
Is there some documentation what else can be set via environment variables?
personally I prefer the option to have command line options as this is a standard way to have a self-documenting software as all the options would then be easily detectable via the standard command wikmd --help and without reading any docs.
It would also not require the creation of any additional files or directories.
Would setting/overriding config options via the command line be something you would accept a PR for?
Another important setting would be the port to run on, as it would allow to run several instances/wikis in parallel on the same computer.
Is there some documentation what else can be set via environment variables?
Here https://linbreux.github.io/wikmd/environment%20variables.html, you could also set the port here :smile:
Would setting/overriding config options via the command line be something you would accept a PR for?
For sure! That would indeed be a nice feature. Maybe the priority needs to be as followed:
- command line options
- ENV vars
- config file
- defaults