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

User configuration #97

Closed
4 of 8 tasks
sharkdp opened this issue Jul 7, 2023 · 2 comments · Fixed by #227
Closed
4 of 8 tasks

User configuration #97

sharkdp opened this issue Jul 7, 2023 · 2 comments · Fixed by #227
Assignees
Labels

Comments

@sharkdp
Copy link
Owner

sharkdp commented Jul 7, 2023

Things that a user might want to configure:

  • REPL Prompt
  • whether or not to show the "Numbat" font
  • Whether or not to pre-fetch currency exchange rates
  • Pretty printing: on/off
  • Paths to the module folder
  • Localization settings (decimal separator)
  • whether or not to use unicode exponents like ², ³, … instead of ^2, ^3
  • number of significant digits that are displayed

See also: #55

@sharkdp sharkdp added the feature label Jul 7, 2023
@sharkdp
Copy link
Owner Author

sharkdp commented Jul 17, 2023

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 26, 2023

Current plan:

Location of the config file:

  • We already have get_config_path() in numbat-cli/src/main.rs. See https://numbat.dev/doc/cli-customization.html#config-path for details where this is located on different systems.
  • We'll assume that a config file config.toml is located in that folder. If it is absent, we do not create it — we just use default settings. We never write to that file.

Format: TOML, unless there are very good reasons for another choice

Implementation:

  • Create a Config struct in numbat-cli/src/config.rs. Use serde and the toml crate to automatically derive deserialization functions for the config struct.

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

Successfully merging a pull request may close this issue.

2 participants