| Crates.io | miniconf-parser |
| lib.rs | miniconf-parser |
| version | 0.1.3 |
| created_at | 2025-11-11 18:09:15.010485+00 |
| updated_at | 2025-11-13 14:34:19.051277+00 |
| description | Pest-powered parser and CLI for the MiniConf configuration format. |
| homepage | https://github.com/kit/miniconf-parser |
| repository | https://github.com/kit/miniconf-parser |
| max_upload_size | |
| id | 1927706 |
| size | 44,894 |
MiniConf is a plain-text configuration format with simple sections and key = value pairs. This crate provides both a reusable parser library and a convenient CLI built on top of a pest grammar.
src/grammar.pest with explicit support for sections, key/value pairs, comments, and arrays.Document, Section, Value) re-exported by the library.thiserror with duplicate-key detection.use miniconf_parser::parse_str;
let doc = parse_str("[service]\nport = 8080\n")?;
println!("sections: {}", doc.sections().count());
miniconf-parser parse config.mc # pretty print
miniconf-parser parse config.mc -f json # emit JSON
miniconf-parser check config.mc # validate only
section_header: [section_name] with alphanumeric, _, or - characters.key_value: key = value with flexible whitespace and optional trailing comments.comment_line: # comment to end-of-line, including inline comments.value: quoted/bare strings, integers/floats, booleans (true/false/yes/no), and arrays like [one, two].make fmt – format the codebase.make clippy – run cargo clippy -- -D warnings to keep lints clean.make test – execute the full test suite in tests/ plus doctests.make doc – build API docs (cargo doc --no-deps).make publish – sanity-check cargo publish --dry-run before releasing.The test suite combines parser-focused cases (tests/parser_tests.rs) with CLI-level integration tests. Shared fixtures live under tests/common/. Examples in examples/ demonstrate typical embedding scenarios.
Comprehensive rustdoc comments and doctests are enabled on docs.rs. Run cargo doc --open for a local copy. The CLI is implemented with clap 4.5, while the library exposes ergonomic error types so downstream applications can surface helpful diagnostics.