From 2c96a2059f15cd0428d3befe4ea7b03d51c5864e Mon Sep 17 00:00:00 2001 From: lz Date: Sun, 29 Sep 2024 15:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(README.md):=20fix=20syntax?= =?UTF-8?q?=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 70847ef..8c192ea 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,16 @@ toml11 is a feature-rich TOML language library for C++11/14/17/20. ## Example +```toml +# example.toml +title = "an example toml file" +nums = [3, 1, 4, 1, 5] # pi! +``` + ```cpp #include #include -// ```toml -// title = "an example toml file" -// nums = [3, 1, 4, 1, 5] # pi! -// ``` - int main() { // select TOML version at runtime (optional) @@ -50,7 +51,7 @@ int main() } if(data.at("nums").is_array()) { - data.push_back(9); + data["nums"].as_array().push_back(9); } // check comments