Skip to content

Commit 32f924f

Browse files
authored
Cleanup README.md, fix broken link. (#1633)
* Cleanup README.md, fix broken link. * cleanup readme vcpkg notes
1 parent b511d9e commit 32f924f

1 file changed

Lines changed: 80 additions & 19 deletions

File tree

README.md

Lines changed: 80 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![badge](https://img.shields.io/badge/document-doxygen-brightgreen)](http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html)
66
[![Coverage Status](https://coveralls.io/repos/github/open-source-parsers/jsoncpp/badge.svg?branch=master)](https://coveralls.io/github/open-source-parsers/jsoncpp?branch=master)
77

8-
98
[JSON][json-org] is a lightweight data-interchange format. It can represent
109
numbers, strings, ordered sequences of values, and collections of name/value
1110
pairs.
@@ -14,18 +13,16 @@ pairs.
1413

1514
JsonCpp is a C++ library that allows manipulating JSON values, including
1615
serialization and deserialization to and from strings. It can also preserve
17-
existing comment in unserialization/serialization steps, making it a convenient
16+
existing comment in deserialization/serialization steps, making it a convenient
1817
format to store user input files.
1918

20-
2119
## Documentation
2220

2321
[JsonCpp documentation][JsonCpp-documentation] is generated using [Doxygen][].
2422

2523
[JsonCpp-documentation]: http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html
2624
[Doxygen]: http://www.doxygen.org
2725

28-
2926
## A note on backward-compatibility
3027

3128
* `1.y.z` is built with C++11.
@@ -34,42 +31,106 @@ format to store user input files.
3431
* Major versions maintain binary-compatibility.
3532

3633
### Special note
37-
The branch `00.11.z`is a new branch, its major version number `00` is to show that it is
38-
different from `0.y.z` and `1.y.z`, the main purpose of this branch is to make a balance
39-
between the other two branches. Thus, users can use some new features in this new branch
40-
that introduced in 1.y.z, but can hardly applied into 0.y.z.
34+
35+
The branch `00.11.z`is a new branch, its major version number `00` is to show
36+
that it is different from `0.y.z` and `1.y.z`, the main purpose of this branch
37+
is to make a balance between the other two branches. Thus, users can use some
38+
new features in this new branch that introduced in 1.y.z, but can hardly applied
39+
into 0.y.z.
4140

4241
## Using JsonCpp in your project
4342

4443
### The vcpkg dependency manager
45-
You can download and install JsonCpp using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
4644

45+
You can download and install JsonCpp using the [vcpkg](https://github.com/Microsoft/vcpkg/)
46+
dependency manager, which has installation instruction dependent on your
47+
build system. For example, if you are in a CMake project, the
48+
[CMake install tutorial](https://learn.microsoft.com/en-us/vcpkg/get_started/get-started?pivots=shell-powershell)
49+
suggests the follow installation method.
50+
51+
First, clone and set up `vcpkg`.
52+
53+
```sh
4754
git clone https://github.com/Microsoft/vcpkg.git
4855
cd vcpkg
4956
./bootstrap-vcpkg.sh
50-
./vcpkg integrate install
51-
./vcpkg install jsoncpp
57+
```
58+
59+
Then, create a [vcpkg.json manifest](https://learn.microsoft.com/en-us/vcpkg/reference/vcpkg-json),
60+
enabling manifest mode and adding JsonCpp to the manifest's dependencies list.
61+
62+
```sh
63+
vcpkg new --application
64+
vcpkg add port jsoncpp
65+
```
66+
67+
> [!NOTE]: you can use vcpkg in either classic mode or manifest mode (recommended).
68+
69+
#### Classic mode
5270

53-
The JsonCpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
71+
If your project does not have a `vcpkg.json`,
72+
your project is in [Classic mode](https://learn.microsoft.com/en-us/vcpkg/concepts/classic-mode)
73+
you can install JsonCpp by directly invoking the `install` command:
74+
75+
```sh
76+
vcpkg install jsoncpp
77+
```
78+
79+
### Manifest mode
80+
81+
If your project *does* have a vcpkg.json manifest, your project is in [Manifest mode](https://learn.microsoft.com/en-us/vcpkg/concepts/manifest-mode)
82+
and you need to add JsonCpp to your package manifest dependencies, then invoke
83+
install with no arguments.
84+
85+
```sh
86+
vcpkg add port jsoncpp
87+
vcpkg install
88+
```
89+
90+
Example manifest:
91+
92+
```sh
93+
{
94+
"name": "best-app-ever",
95+
"dependencies": [ "jsoncpp" ],
96+
}
97+
```
98+
99+
> [!NOTE] The JsonCpp port in vcpkg is kept up to date by Microsoft team members and community contributors.
100+
> If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg)
101+
> on the vcpkg repository.
54102
55103
### Conan package manager
56104

57-
You can download and install JsonCpp using the [Conan](https://conan.io/) package manager:
105+
You can download and install JsonCpp using the [Conan](https://conan.io/)
106+
package manager:
58107

108+
```sh
59109
conan install -r conancenter --requires="jsoncpp/[*]" --build=missing
110+
```
60111

61-
The JsonCpp package in Conan Center is kept up to date by [ConanCenterIndex](https://github.com/conan-io/conan-center-index) contributors. If the version is out of date, please create an issue or pull request on the Conan Center Index repository.
112+
The JsonCpp package in Conan Center is kept up to date by [ConanCenterIndex](https://github.com/conan-io/conan-center-index)
113+
contributors. If the version is out of date, please create an issue or pull request on the
114+
Conan Center Index repository.
62115

63116
### Amalgamated source
64-
https://github.com/open-source-parsers/jsoncpp/wiki/Amalgamated-(Possibly-outdated)
117+
118+
See the [Wiki entry on Amalgamated Source](https://github.com/open-source-parsers/jsoncpp/wiki/Amalgamated-(Possibly-outdated)).
65119

66120
### The Meson Build System
67-
If you are using the [Meson Build System](http://mesonbuild.com), then you can get a wrap file by downloading it from [Meson WrapDB](https://wrapdb.mesonbuild.com/jsoncpp), or simply use `meson wrap install jsoncpp`.
121+
122+
If you are using the [Meson Build System](http://mesonbuild.com), then you can
123+
get a wrap file by downloading it from [Meson WrapDB](https://mesonbuild.com/Wrapdb-projects.html),
124+
or simply use `meson wrap install jsoncpp`.
68125

69126
### Other ways
70-
If you have trouble, see the [Wiki](https://github.com/open-source-parsers/jsoncpp/wiki), or post a question as an Issue.
127+
128+
If you have trouble, see the
129+
[Wiki](https://github.com/open-source-parsers/jsoncpp/wiki), or post a question
130+
as an Issue.
71131

72132
## License
73133

74-
See the `LICENSE` file for details. In summary, JsonCpp is licensed under the
75-
MIT license, or public domain if desired and recognized in your jurisdiction.
134+
See the [LICENSE](./LICENSE) file for details. In summary, JsonCpp is licensed
135+
under the MIT license, or public domain if desired and recognized in your
136+
jurisdiction.

0 commit comments

Comments
 (0)