Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Jun 18, 2020
1 parent f7d4bf8 commit 7ec63a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ let my_value = config.getint("somesection", "someintvalue")?.unwrap();
## Supported `ini` file structure
A configuration file can consist of sections, each led by a `[section-name]` header, followed by key-value entries separated by a `=`. By default, section names and key names are case-insensitive. All leading and trailing whitespace is removed from stored keys, values and section names.
Key values can be omitted, in which case the key-value delimiter (`=`) may also be left out (but this is different from putting a delimiter, we'll
explain it later). Key-value pairs or section headers cannot span multiple lines.
Owing to how ini files usually are, this means that `[`, `]` and `=` are special symbols (this crate will allow you to use `]` sparingly).
explain it later). You can use comment symbols (`;` to denote comments). It is planned to allow configuring this via the API in the future.
Keep in mind that key-value pairs or section headers cannot span multiple lines.
Owing to how ini files usually are, this means that `[`, `]`, `=`, ';' are special symbols (this crate will allow you to use `]` sparingly).
Let's take for example:
```INI
Expand All @@ -49,7 +50,8 @@ Let's take for example:
are the section headers above same? = yes
sectionheaders_and_keysarestored_in_lowercase? = yes
keys_are_also_case_insensitive = Values are case sensitive
spaces in keys=allowed
;anything after a comment symbol is ignored
spaces in keys=allowed ;everything before this is still valid!
spaces in values=allowed as well
spaces around the delimiter = also OK
Expand Down

0 comments on commit 7ec63a0

Please sign in to comment.