Skip to content
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

Support command line options, especially for choosing a different wiki directory? #177

Open
johann-petrak opened this issue Oct 17, 2024 · 3 comments

Comments

@johann-petrak
Copy link

I think it would be convenient to be able to start the wiki using something like wikmd --dir /my/wikidir --conf myconfigfile.cfg

@Linbreux
Copy link
Owner

@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:

with open(os.path.join(__location__, WIKMD_CONFIG_FILE)) as f:
yaml_config = yaml.safe_load(f)

If you have any questions or run into issues, don't hesitate to reach out!

@johann-petrak
Copy link
Author

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.

@Linbreux
Copy link
Owner

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 😄

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:

  1. command line options
  2. ENV vars
  3. config file
  4. defaults

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants