2 releases
0.1.1 | Dec 21, 2024 |
---|---|
0.1.0 | Dec 21, 2024 |
#73 in #header
300 downloads per month
2MB
57 lines
Summary
This Rust library is used for parsing hierarchic configuration files with markdown headers. It allows you to easily read and parse configuration files that follow a specific format.
File format
The configuration file has to follow a specific format using markdown headers and key-value pairs.
The format looks like this:
key1 value
key2
# HeaderA
key1 value
key2
# HeaderB
key1 value
key2
## SubheaderA
key1 value
key2
## SubheaderB
key1 value
key2
The created mapping will be something like this:
"key1" -> "value"
"key2" -> ""
"HeaderA:key1" -> "value"
"HeaderA:key2" -> ""
"HeaderB:key1" -> "value"
"HeaderB:key2" -> ""
"HeaderB:SubheaderA:key1" -> "value"
"HeaderB:SubheaderA:key2" -> ""
"HeaderB:SubheaderB:key1" -> "value"
"HeaderB:SubheaderB:key2" -> ""
lib.rs
:
This library parses hierarchic configuration files in a markdown inspired format.
Therefore the parse_config
function is provided.
*