docs: fix license in readme

This commit is contained in:
Kat Marchán 2021-09-22 10:39:31 -07:00
parent a358750d89
commit d8715c8d41
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 42 additions and 63 deletions

View File

@ -22,9 +22,45 @@ on the [spec repo's discussions
page](https://github.com/kdoclang/kdl/discussions). Feel free to jump in and
give us your 2 cents!
## Example KDL File
```text
author "Alex Monad" email="alex@example.com" active=true
contents {
section "First section" {
paragraph "This is the first paragraph"
paragraph "This is the second paragraph"
}
}
// unicode! comments!
π 3.14159
```
## Basic Library Example
```
use kdl::{KdlNode, KdlValue};
use std::collections::HashMap;
assert_eq!(
kdl::parse_document("node 1 key=true").unwrap(),
vec![
KdlNode {
name: String::from("node"),
values: vec![KdlValue::Int(1)],
properties: {
let mut temp = HashMap::new();
temp.insert(String::from("key"), KdlValue::Boolean(true));
temp
},
children: vec![],
}
]
)
```
## License
The code in this repository is covered by [the Parity License](LICENSE.md), a
strong copyleft license. That means that you can only use this project if
you're working on an open source-licensed product (MIT/Apache projects are
ok!)
The code in this repository is covered by [the Apache-2.0 License](LICENSE.md).

View File

@ -1,63 +1,6 @@
#![doc(html_logo_url = "https://kdl.dev/logo.svg")]
//! KDL is a document language with xml-like semantics that looks like you're invoking a bunch of
//! CLI commands! It's meant to be used both as a serialization format and a configuration language,
//! much like JSON, YAML, or XML.
//!
//! There's a [living specification], as well as [various implementations]. You can also check out the
//! [language FAQ] to answer all your burning questions!
//!
//! This crate is the official/reference implementation of the KDL document language.
//!
//! [living specification]: https://github.com/kdl-org/kdl/blob/main/SPEC.md
//! [various implementations]: https://kdl.dev/#implementations
//! [language FAQ]: https://kdl.dev/#faq
//!
//! ## License
//!
//! The code in this crate is covered by the [Parity License], a strong copyleft license. That
//! means that you can only use this project if you're working on an open source-licensed product
//! (MIT/Apache projects are ok!)
//!
//! [Parity License]: https://github.com/kdl-org/kdl-rs/blob/main/LICENSE.md
//!
//! ## Example KDL File
//!
//! ```text
//! author "Alex Monad" email="alex@example.com" active=true
//!
//! contents {
//! section "First section" {
//! paragraph "This is the first paragraph"
//! paragraph "This is the second paragraph"
//! }
//! }
//!
//! // unicode! comments!
//! π 3.14159
//! ```
//!
//! ## Basic Library Example
//!
//! ```
//! use kdl::{KdlNode, KdlValue};
//! use std::collections::HashMap;
//!
//! assert_eq!(
//! kdl::parse_document("node 1 key=true").unwrap(),
//! vec![
//! KdlNode {
//! name: String::from("node"),
//! values: vec![KdlValue::Int(1)],
//! properties: {
//! let mut temp = HashMap::new();
//! temp.insert(String::from("key"), KdlValue::Boolean(true));
//! temp
//! },
//! children: vec![],
//! }
//! ]
//! )
//! ```
#![doc = include_str!("../README.md")]
use nom::combinator::all_consuming;
use nom::Finish;