diff --git a/doc/mkdocs/docs/api/basic_json/basic_json.md b/doc/mkdocs/docs/api/basic_json/basic_json.md index c5d7db31e..afa3901d1 100644 --- a/doc/mkdocs/docs/api/basic_json/basic_json.md +++ b/doc/mkdocs/docs/api/basic_json/basic_json.md @@ -256,7 +256,7 @@ basic_json(basic_json&& other) noexcept; cases are detected; see the description of the exceptions above. A violation of this precondition yields undefined behavior. - !!! danger + !!! danger "Runtime assertion" A precondition is enforced with a [runtime assertion](../../features/assertions.md). diff --git a/doc/mkdocs/docs/api/basic_json/get.md b/doc/mkdocs/docs/api/basic_json/get.md index 0a0bc3bab..96fc221da 100644 --- a/doc/mkdocs/docs/api/basic_json/get.md +++ b/doc/mkdocs/docs/api/basic_json/get.md @@ -90,7 +90,7 @@ Depends on what `json_serializer` `from_json()` method throws ## Notes -!!! warning +!!! danger "Undefined behavior" Writing data to the pointee (overload 3) of the result yields an undefined state. diff --git a/doc/mkdocs/docs/api/basic_json/get_ptr.md b/doc/mkdocs/docs/api/basic_json/get_ptr.md index 72517cd7e..2441e1156 100644 --- a/doc/mkdocs/docs/api/basic_json/get_ptr.md +++ b/doc/mkdocs/docs/api/basic_json/get_ptr.md @@ -33,7 +33,7 @@ Constant. ## Notes -!!! warning +!!! danger "Undefined behavior" Writing data to the pointee of the result yields an undefined state. diff --git a/doc/mkdocs/docs/api/basic_json/get_ref.md b/doc/mkdocs/docs/api/basic_json/get_ref.md index 6e794902c..b1219742c 100644 --- a/doc/mkdocs/docs/api/basic_json/get_ref.md +++ b/doc/mkdocs/docs/api/basic_json/get_ref.md @@ -38,7 +38,7 @@ Constant. ## Notes -!!! warning +!!! danger "Undefined behavior" Writing data to the referee of the result yields an undefined state. diff --git a/doc/mkdocs/docs/api/basic_json/is_discarded.md b/doc/mkdocs/docs/api/basic_json/is_discarded.md index 6de31c937..663cbf889 100644 --- a/doc/mkdocs/docs/api/basic_json/is_discarded.md +++ b/doc/mkdocs/docs/api/basic_json/is_discarded.md @@ -24,7 +24,7 @@ Constant. ## Notes -!!! note +!!! note "Comparisons" Discarded values are never compared equal with [`operator==`](operator_eq.md). That is, checking whether a JSON value `j` is discarded will only work via: @@ -41,7 +41,7 @@ Constant. will always be `#!cpp false`. -!!! note +!!! note "Removal during parsing with callback functions" When a value is discarded by a callback function (see [`parser_callback_t`](parser_callback_t.md)) during parsing, then it is removed when it is part of a structured value. For instance, if the second value of an array is discarded, diff --git a/doc/mkdocs/docs/api/basic_json/items.md b/doc/mkdocs/docs/api/basic_json/items.md index b388824f9..0b34ddcba 100644 --- a/doc/mkdocs/docs/api/basic_json/items.md +++ b/doc/mkdocs/docs/api/basic_json/items.md @@ -63,7 +63,7 @@ Constant. When iterating over an array, `key()` will return the index of the element as string (see example). For primitive types (e.g., numbers), `key()` returns an empty string. -!!! warning +!!! danger "Lifetime issues" Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exceeds the iteration. See for more information. diff --git a/doc/mkdocs/docs/api/basic_json/operator[].md b/doc/mkdocs/docs/api/basic_json/operator[].md index 9e41b5136..5c480ffc3 100644 --- a/doc/mkdocs/docs/api/basic_json/operator[].md +++ b/doc/mkdocs/docs/api/basic_json/operator[].md @@ -74,7 +74,7 @@ Strong exception safety: if an exception occurs, the original value stays intact ## Notes -!!! danger +!!! danger "Undefined behavior" 1. If the element with key `idx` does not exist, the behavior is undefined. 2. If the element with key `key` does not exist, the behavior is undefined and is **guarded by a diff --git a/doc/mkdocs/docs/api/basic_json/value.md b/doc/mkdocs/docs/api/basic_json/value.md index 0b4f1cc19..1844c41fb 100644 --- a/doc/mkdocs/docs/api/basic_json/value.md +++ b/doc/mkdocs/docs/api/basic_json/value.md @@ -36,7 +36,7 @@ ValueType value(const json_pointer& ptr, } ``` -!!! note +!!! note "Differences to `at` and `operator[]`" - Unlike [`at`](at.md), this function does not throw if the given `key`/`ptr` was not found. - Unlike [`operator[]`](operator[].md), this function does not implicitly add an element to the position defined by diff --git a/doc/mkdocs/docs/api/macros/json_diagnostics.md b/doc/mkdocs/docs/api/macros/json_diagnostics.md index 82b1f131b..3f73e39bd 100644 --- a/doc/mkdocs/docs/api/macros/json_diagnostics.md +++ b/doc/mkdocs/docs/api/macros/json_diagnostics.md @@ -26,7 +26,7 @@ When the macro is not defined, the library will define it to its default value. ## Notes -!!! warning +!!! danger "ODR violation" As this macro changes the definition of the `basic_json` object, it MUST be defined in the same way globally, even across different compilation units; DO NOT link together code compiled with different definitions of diff --git a/doc/mkdocs/docs/api/macros/json_skip_library_version_check.md b/doc/mkdocs/docs/api/macros/json_skip_library_version_check.md index 4dd9f04b0..c9a743c18 100644 --- a/doc/mkdocs/docs/api/macros/json_skip_library_version_check.md +++ b/doc/mkdocs/docs/api/macros/json_skip_library_version_check.md @@ -17,7 +17,7 @@ By default, the macro is not defined. ## Notes -!!! warning +!!! danger "ABI compatibility" Mixing different library versions in the same code can be a problem as the different versions may not be ABI compatible. diff --git a/doc/mkdocs/scripts/check_structure.py b/doc/mkdocs/scripts/check_structure.py index 13dca0332..92f6ff182 100755 --- a/doc/mkdocs/scripts/check_structure.py +++ b/doc/mkdocs/scripts/check_structure.py @@ -100,9 +100,9 @@ def check_structure(): if line == '' and previous_line == '': report('whitespace/blank_lines', f'{file}:{lineno}-{lineno+1}', 'consecutive blank lines') - # check that admonitions have titles - untitled_admonition = re.match(r'^(\?\?\?|!!!) (note|info)$', line) - if untitled_admonition: + # check that non-example admonitions have titles + untitled_admonition = re.match(r'^(\?\?\?|!!!) ([^ ]+)$', line) + if untitled_admonition and untitled_admonition.group(2) != 'example': report('style/admonition_title', f'{file}:{lineno}', f'"{untitled_admonition.group(2)}" admonitions should have a title') previous_line = line