From f76f0f253aa56e1893b991e30afa2d3be1e4f39d Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 14 Sep 2025 15:57:40 -0400 Subject: Add README --- README.md | 35 +++++++++++++++++++++++++++++++++++ src/lib.rs | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7188b9e --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# pom-rs + +Rust parser for [POM configuration language](https://pom.computer) + +## Basic usage + +```rust +use pom_parser::Configuration; +let conf = Configuration::load_path("examples/conf.pom").expect("bad configuration"); +let indentation_type = conf.get("indentation-type"); +match indentation_type { + Some(t) => println!("indenting with {t}!"), + None => println!("no indentation type set!"), +} +let tab_size = conf.get_int_or_default("tab-size", 4) + .expect("invalid number for tab-size!"); +println!("tab size: {tab_size}"); +``` + +See `examples/` for more examples. + +## License + +```text +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +``` diff --git a/src/lib.rs b/src/lib.rs index c6ee93e..6b061bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! Parser for the [POM file format](https://www.pom.computer/index.html). +#![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] #![deny(missing_docs)] #![warn(clippy::semicolon_if_nothing_returned)] -- cgit v1.2.3