diff --git a/README.md b/README.md index 70847ef9..7e18612b 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 @@ -70,20 +71,36 @@ int main() } ``` + For more details, please refer to the [documentation](https://toruniina.github.io/toml11/). ## Table of Contents -- [Integration](#integration) -- [Features](#features) - - [parsing a file](#parsing-a-file) - - [finding a value](#finding-a-value) - - [comments](#comments) - - [error messages](#error-messages) - - [serialization](#serialization) -- [Breaking Changes from v3](#changes-from-v3) -- [Contributors](#contributors) -- [Licensing Terms](#licensing-terms) +- [toml11](#toml11) + - [Example](#example) + - [Table of Contents](#table-of-contents) + - [Integration](#integration) + - [Single Include File](#single-include-file) + - [git submodule](#git-submodule) + - [CMake `FetchContent`](#cmake-fetchcontent) + - [CMake Package Manager (CPM)](#cmake-package-manager-cpm) + - [Install Using CMake](#install-using-cmake) + - [Precompile Library](#precompile-library) + - [Building Example](#building-example) + - [Building Tests](#building-tests) + - [Features](#features) + - [Parsing a File](#parsing-a-file) + - [finding a value](#finding-a-value) + - [comments](#comments) + - [error messages](#error-messages) + - [serialization](#serialization) + - [Configuring Types](#configuring-types) + - [Examples](#examples) + - [Changes from v3](#changes-from-v3) + - [Breaking Changes](#breaking-changes) + - [Added features](#added-features) + - [Contributors](#contributors) + - [Licensing terms](#licensing-terms) ## Integration