From a0863b8c20a97bc90783b7a5824361cc189528fc Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 17 Jul 2021 13:44:54 +0200 Subject: [PATCH] :memo: add support section --- README.md | 11 +++++++++++ doc/mkdocs/docs/integration/index.md | 4 ++-- doc/mkdocs/docs/integration/package_managers.md | 6 +++--- doc/mkdocs/docs/integration/pkg-config.md | 13 +++++++++++++ doc/mkdocs/mkdocs.yml | 4 ++-- 5 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 doc/mkdocs/docs/integration/pkg-config.md diff --git a/README.md b/README.md index b4b6dfe98..9f972c211 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ - [Design goals](#design-goals) - [Sponsors](#sponsors) +- [Support](#support) ([documentation](https://json.nlohmann.me), [FAQ](http://127.0.0.1:8000/home/faq/), [discussions](https://github.com/nlohmann/json/discussions), [API](https://json.nlohmann.me/api/basic_json/), [bug issues](https://github.com/nlohmann/json/issues)) - [Examples](#examples) - [JSON as first-class data type](#json-as-first-class-data-type) - [Serialization / Deserialization](#serialization--deserialization) @@ -79,6 +80,16 @@ You can sponsor this library at [GitHub Sponsors](https://github.com/sponsors/nl Thanks everyone! +## Support + +:question: If you have a **question**, please check if it is already answered in the [**FAQ**](https://json.nlohmann.me/home/faq/) or the [**Q&A**](https://github.com/nlohmann/json/discussions/categories/q-a) section. If not, please [**ask a new question**](https://github.com/nlohmann/json/discussions/new) there. + +:books: If you want to **learn more** about how to use the library, check out the rest of the [**README**](#examples), have a look at [**code examples**](https://github.com/nlohmann/json/tree/develop/doc/examples), or browse through the [**help pages**](https://json.nlohmann.me). + +:construction: If you want to understand the **API** better, check out the [**API Reference**](https://json.nlohmann.me/api/basic_json/) or the [**Doxygen documentation**](https://json.nlohmann.me/doxygen/index.html). + +:bug: If you found a **bug**, please check the [**FAQ**](https://json.nlohmann.me/home/faq/) if it is a known issue or the result of a design decision. Please also have a look at the [**issue list**](https://github.com/nlohmann/json/issues) before you [**create a new issue**](https://github.com/nlohmann/json/issues/new/choose). Please provide as many information as possible to help us understand and reproduce your issue. + ## Examples diff --git a/doc/mkdocs/docs/integration/index.md b/doc/mkdocs/docs/integration/index.md index 5dd8cceb7..5ee4ff721 100644 --- a/doc/mkdocs/docs/integration/index.md +++ b/doc/mkdocs/docs/integration/index.md @@ -1,4 +1,4 @@ -# Integration +# Header only [`json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) is the single required file in `single_include/nlohmann` or [released here](https://github.com/nlohmann/json/releases). You need to add @@ -11,4 +11,4 @@ using json = nlohmann::json; to the files you want to process JSON and set the necessary switches to enable C++11 (e.g., `-std=c++11` for GCC and Clang). -You can further use file [`include/nlohmann/json_fwd.hpp`](https://github.com/nlohmann/json/blob/develop/include/nlohmann/json_fwd.hpp) for forward-declarations. The installation of json_fwd.hpp (as part of cmake's install step), can be achieved by setting `-DJSON_MultipleHeaders=ON`. +You can further use file [`include/nlohmann/json_fwd.hpp`](https://github.com/nlohmann/json/blob/develop/include/nlohmann/json_fwd.hpp) for forward-declarations. The installation of `json_fwd.hpp` (as part of CMake's install step), can be achieved by setting `-DJSON_MultipleHeaders=ON`. diff --git a/doc/mkdocs/docs/integration/package_managers.md b/doc/mkdocs/docs/integration/package_managers.md index 633bc3472..b860296ab 100644 --- a/doc/mkdocs/docs/integration/package_managers.md +++ b/doc/mkdocs/docs/integration/package_managers.md @@ -24,7 +24,7 @@ brew install nlohmann-json --HEAD instead. -!!! example +??? example 1. Create the following file: @@ -63,7 +63,7 @@ The provided meson.build can also be used as an alternative to cmake for install If you are using [Conan](https://www.conan.io/) to manage your dependencies, merely add `nlohmann_json/x.y.z` to your `conanfile`'s requires, where `x.y.z` is the release version you want to use. Please file issues [here](https://github.com/conan-io/conan-center-index/issues) if you experience problems with the packages. -!!! example +??? example 1. Create the following files: @@ -141,7 +141,7 @@ Please file issues [here](https://github.com/build2-packaging/nlohmann-json) if If you are using [`wsjcpp`](http://wsjcpp.org), you can use the command `wsjcpp install "https://github.com/nlohmann/json:develop"` to get the latest version. Note you can change the branch ":develop" to an existing tag or another branch. -### CPM.cmake +## CPM.cmake If you are using [`CPM.cmake`](https://github.com/TheLartians/CPM.cmake), you can check this [`example`](https://github.com/TheLartians/CPM.cmake/tree/master/examples/json). After [adding CPM script](https://github.com/TheLartians/CPM.cmake#adding-cpm) to your project, implement the following snippet to your CMake: diff --git a/doc/mkdocs/docs/integration/pkg-config.md b/doc/mkdocs/docs/integration/pkg-config.md new file mode 100644 index 000000000..56f86444e --- /dev/null +++ b/doc/mkdocs/docs/integration/pkg-config.md @@ -0,0 +1,13 @@ +# Pkg-config + +If you are using bare Makefiles, you can use `pkg-config` to generate the include flags that point to where the library is installed: + +```sh +pkg-config nlohmann_json --cflags +``` + +Users of the [Meson build system](package_managers.md#meson) will also be able to use a system wide library, which will be found by `pkg-config`: + +```meson +json = dependency('nlohmann_json', required: true) +``` diff --git a/doc/mkdocs/mkdocs.yml b/doc/mkdocs/mkdocs.yml index b7ad380fe..7aa6e2c5d 100644 --- a/doc/mkdocs/mkdocs.yml +++ b/doc/mkdocs/mkdocs.yml @@ -69,8 +69,8 @@ nav: - integration/index.md - integration/cmake.md - integration/package_managers.md - - Doxygen: - - doxygen/index.html + - integration/pkg-config.md + - Doxygen: doxygen/index.html - API: - basic_json: - api/basic_json/index.md