Skip to content

Commit 8fb5d6f

Browse files
authored
Some documentation updates (#4636)
Signed-off-by: Niels Lohmann <[email protected]>
1 parent 2dc8205 commit 8fb5d6f

10 files changed

+50
-4
lines changed

docs/mkdocs/docs/api/json_pointer/operator_string_t.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ operator string_t() const
4242
--8<-- "examples/json_pointer__operator_string_t.output"
4343
```
4444

45+
## See also
46+
47+
- [string_t](../basic_json/string_t.md)- type for strings
48+
4549
## Version history
4650

4751
- Since version 2.0.0.

docs/mkdocs/docs/api/macros/json_assert.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ Therefore, assertions can be switched off by defining `NDEBUG`.
7979
assertion error in operator[]
8080
```
8181

82+
## See also
83+
84+
- [Runtime Assertions](../../features/assertions.md) - overview documentation
85+
8286
## Version history
8387

8488
- Added in version 3.9.0.

docs/mkdocs/docs/api/macros/json_diagnostic_positions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ When the macro is not defined, the library will define it to its default value.
108108
```
109109

110110
The output shows the exception with diagnostic path info and start/end positions.
111+
112+
## See also
113+
114+
- [:simple-cmake: JSON_Diagnostic_Positions](../../integration/cmake.md#json_diagnostic_positions) - CMake option to control the macro
115+
- [JSON_DIAGNOSTICS](json_diagnostics.md) - macro to control extended diagnostics
116+
111117
## Version history
112118

113119
- Added in version 3.12.0.

docs/mkdocs/docs/api/macros/json_diagnostics.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ When the macro is not defined, the library will define it to its default value.
8282
--8<-- "examples/diagnostic_positions_exception.output"
8383
```
8484
The output shows the exception with start/end positions only.
85-
85+
86+
## See also
87+
88+
- [:simple-cmake: JSON_Diagnostics](../../integration/cmake.md#json_diagnostics) - CMake option to control the macro
89+
- [JSON_DIAGNOSTIC_POSITIONS](json_diagnostic_positions.md) - macro to access positions of elements
90+
8691
## Version history
8792

8893
- Added in version 3.10.0.

docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ The default value is `0`.
145145

146146
## See also
147147

148-
- [`NLOHMANN_JSON_SERIALIZE_ENUM`](nlohmann_json_serialize_enum.md)
148+
- [:simple-cmake: JSON_DisableEnumSerialization](../../integration/cmake.md#json_disableenumserialization) - CMake option to control
149+
the macro
150+
- [`NLOHMANN_JSON_SERIALIZE_ENUM`](nlohmann_json_serialize_enum.md) - serialize/deserialize an enum
149151

150152
## Version history
151153

docs/mkdocs/docs/api/macros/json_use_global_udls.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ When the macro is not defined, the library will define it to its default value.
9292

9393
- [`operator""_json`](../operator_literal_json.md)
9494
- [`operator""_json_pointer`](../operator_literal_json_pointer.md)
95+
- [:simple-cmake: JSON_GlobalUDLs](../../integration/cmake.md#json_globaludls) - CMake option to control the macro
9596

9697
## Version history
9798

docs/mkdocs/docs/api/macros/json_use_implicit_conversions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ By default, implicit conversions are enabled.
5353

5454
- [**operator ValueType**](../basic_json/operator_ValueType.md) - get a value (implicit)
5555
- [**get**](../basic_json/get.md) - get a value (explicit)
56+
- [:simple-cmake: JSON_ImplicitConversions](../../integration/cmake.md#json_implicitconversions) - CMake option to control the macro
5657

5758
## Version history
5859

docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ When the macro is not defined, the library will define it to its default value.
7272
...
7373
```
7474

75+
### See also
76+
77+
- [:simple-cmake: JSON_LegacyDiscardedValueComparison](../../integration/cmake.md#json_legacydiscardedvaluecomparison) - CMake option to control the macro
78+
7579
## Version history
7680

7781
- Added in version 3.11.0.

docs/mkdocs/docs/features/assertions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,7 @@ result in undefined behavior. Since version 3.11.4, this library checks for `nul
138138
```
139139
[json.exception.parse_error.101] parse error: attempting to parse an empty input; check that your input string or stream contains the expected JSON
140140
```
141+
142+
## See also
143+
144+
- [JSON_ASSERT](../api/macros/json_assert.md) - control behavior of runtime assertions

docs/mkdocs/docs/features/macros.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,26 @@ When enabled, exception messages contain a [JSON Pointer](json_pointer.md) to th
2424
exception, see [Extended diagnostic messages](../home/exceptions.md#extended-diagnostic-messages) for an example. Note
2525
that enabling this macro increases the size of every JSON value by one pointer and adds some runtime overhead.
2626

27-
The diagnostics messages can also be controlled with the CMake option `JSON_Diagnostics` (`OFF` by default) which sets
28-
`JSON_DIAGNOSTICS` accordingly.
27+
The diagnostics messages can also be controlled with the CMake option
28+
[`JSON_Diagnostics`](../integration/cmake.md#json_diagnostics) (`OFF` by default) which sets `JSON_DIAGNOSTICS`
29+
accordingly.
2930

3031
See [full documentation of `JSON_DIAGNOSTICS`](../api/macros/json_diagnostics.md).
3132

33+
## `JSON_DIAGNOSTIC_POSITIONS`
34+
35+
When enabled, two new member functions [`start_pos()`](../api/basic_json/start_pos.md) and
36+
[`end_pos()`](../api/basic_json/end_pos.md) are added to [`basic_json`](../api/basic_json/index.md) values. If the value
37+
was created by calling the[`parse`](../api/basic_json/parse.md) function, then these functions allow to query the byte
38+
positions of the value in the input it was parsed from. The byte positions are also used in exceptions to help locate
39+
errors.
40+
41+
The diagnostics positions can also be controlled with the CMake option
42+
[`JSON_Diagnostic_Positions`](../integration/cmake.md#json_diagnostic_positions) (`OFF` by default) which sets
43+
`JSON_DIAGNOSTIC_POSITIONS` accordingly.
44+
45+
See [full documentation of `JSON_DIAGNOSTIC_POSITIONS`](../api/macros/json_diagnostic_positions.md)
46+
3247
## `JSON_HAS_CPP_11`, `JSON_HAS_CPP_14`, `JSON_HAS_CPP_17`, `JSON_HAS_CPP_20`
3348

3449
The library targets C++11, but also supports some features introduced in later C++ versions (e.g., `std::string_view`

0 commit comments

Comments
 (0)