#header #configuration #markdown #parser #file #value #hierarchic

header-config

Parse hierarchic configuration files with markdown headers

2 releases

0.1.1 Dec 21, 2024
0.1.0 Dec 21, 2024

#73 in #header

Download history 231/week @ 2024-12-16 69/week @ 2024-12-23

300 downloads per month

MIT/Apache

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. *

Dependencies