mirror of
https://github.com/nlohmann/json.git
synced 2026-10-31 09:55:42 +00:00
* docs: new design for the documentation site Apply the brand to the Material for MkDocs site: Inter and JetBrains Mono served by the site (upright and real italic), brand colours, blue header band with the syntax pattern, wordmark in the header, new home page (hero, cards, animated feature tour), 404 page, polish for tabs, search, footer, focus rings, tables and code blocks, and theme features (code copy, previous/next footer, TOC follow, search suggestions). Draw the number railroad diagram, the parser callback events and the iterator illustrations as inline SVGs that follow the light and dark scheme. The generator scripts are in docs/mkdocs/scripts/figures; the feature slideshow (json-light.svg, json-dark.svg, replacing json.gif on the home page) is built by docs/mkdocs/scripts/slideshow. Decision nodes in five flowcharts become hexagons, which need far less room. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * docs: add figures, table captions and a macro chooser - Figures with numbered captions: SAX stepper, json_view layout and edit stepper, exception map, JSON pointer and patch walkers, QA pipeline, scaling and binary size charts, roadmap lanes, release timeline, integration decision tree and namespace builder - Table captions (nj-table-caption) on 9 pages - Compile times: modules and PCH charts, filesystem section, re-measured Figure 1, links between features/modules.md and compile_times.md - Interactive macro chooser for features/arbitrary_types.md - Link check: exclude URLs that answer the plugin with 400/401/419 or are dead (customers.md) Signed-off-by: Niels Lohmann <mail@nlohmann.me> * docs: macro chooser generates adl_serializer for non-default-constructible types Signed-off-by: Niels Lohmann <mail@nlohmann.me> * docs: cross-link concept pages and API pages in See also sections Add See also links in both directions between the concept pages (features, home, integration) and the API pages, write API links in code font, give every entry a comment after a dash, and show the callback event figure on the parser callbacks page. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * docs: address review comments on the new design - Home: add a "Latest release" button - Sponsors: update the list and group it by tier - Features: list all feature pages on the index page - Releases: add highlights per release, link the 4.0 roadmap, add the first commit to the timeline - Exceptions: prefix all example messages with the exception name - API: no code font for format names in the See also links of the to_/from_ pages - Merge Patch: show the document before, the patch, and the result - Replace "--" with typographic dashes, mark external links with an icon, center Mermaid diagrams Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
51 lines
4.5 KiB
XML
51 lines
4.5 KiB
XML
<svg class="nj-fig nj-fig--sax-buf" viewBox="0 0 700 442" role="img" aria-labelledby="fig-sax-buf-title fig-sax-buf-desc" xmlns="http://www.w3.org/2000/svg">
|
|
<title id="fig-sax-buf-title">Buffering chunks until the value is complete: five chunks of {"name": "Mary", "list": [1, 2, 3]} appended to a buffer.</title>
|
|
<desc id="fig-sax-buf-desc">After chunks 1 to 4 the buffer has 4, 12, 19, and 30 bytes, and parsing it fails at byte 5, 13, 20, and 31: one past the end, so the input is incomplete and the program waits for more. After chunk 5 the buffer of 35 bytes parses as one complete value. For the input [1, ] of 5 bytes the error is at byte 5, before the end, so it is a real syntax error. Every attempt parses the buffer from byte 1, so 4 + 12 + 19 + 30 + 35 = 100 bytes are parsed for a 35-byte value, and the work grows quadratically.</desc>
|
|
<text class="fg-h" x="16" y="24">chunk</text>
|
|
<text class="fg-h" x="96" y="24">buffer, parsed from byte 1 each time</text>
|
|
<text class="fg-h" x="420" y="24">result</text>
|
|
<text class="fg-note fg-note--l" x="16" y="67">chunk 1</text>
|
|
<rect class="nj-sax-new" x="96" y="50" width="36.6" height="24" rx="4"/>
|
|
<text class="nj-sax-buf" x="96" y="67" xml:space="preserve">{"na</text>
|
|
<path class="nj-sax-caret nj-sax-s-wait" d="M133.8 76 l-5 8 h10 z"/>
|
|
<text class="nj-sax-status nj-sax-s-wait" x="420" y="61">error at byte 5 = size + 1</text>
|
|
<text class="fg-note fg-note--l" x="420" y="77">incomplete: wait for more</text>
|
|
<text class="fg-note fg-note--l" x="16" y="117">chunk 2</text>
|
|
<rect class="nj-sax-old" x="93" y="100" width="36.6" height="24" rx="4"/>
|
|
<rect class="nj-sax-new" x="129.6" y="100" width="70.2" height="24" rx="4"/>
|
|
<text class="nj-sax-buf" x="96" y="117" xml:space="preserve">{"name": "Ma</text>
|
|
<path class="nj-sax-caret nj-sax-s-wait" d="M201 126 l-5 8 h10 z"/>
|
|
<text class="nj-sax-status nj-sax-s-wait" x="420" y="111">error at byte 13 = size + 1</text>
|
|
<text class="fg-note fg-note--l" x="420" y="127">incomplete: wait for more</text>
|
|
<text class="fg-note fg-note--l" x="16" y="167">chunk 3</text>
|
|
<rect class="nj-sax-old" x="93" y="150" width="103.8" height="24" rx="4"/>
|
|
<rect class="nj-sax-new" x="196.8" y="150" width="61.8" height="24" rx="4"/>
|
|
<text class="nj-sax-buf" x="96" y="167" xml:space="preserve">{"name": "Mary", "l</text>
|
|
<path class="nj-sax-caret nj-sax-s-wait" d="M259.8 176 l-5 8 h10 z"/>
|
|
<text class="nj-sax-status nj-sax-s-wait" x="420" y="161">error at byte 20 = size + 1</text>
|
|
<text class="fg-note fg-note--l" x="420" y="177">incomplete: wait for more</text>
|
|
<text class="fg-note fg-note--l" x="16" y="217">chunk 4</text>
|
|
<rect class="nj-sax-old" x="93" y="200" width="162.6" height="24" rx="4"/>
|
|
<rect class="nj-sax-new" x="255.6" y="200" width="95.4" height="24" rx="4"/>
|
|
<text class="nj-sax-buf" x="96" y="217" xml:space="preserve">{"name": "Mary", "list": [1, 2</text>
|
|
<path class="nj-sax-caret nj-sax-s-wait" d="M352.2 226 l-5 8 h10 z"/>
|
|
<text class="nj-sax-status nj-sax-s-wait" x="420" y="211">error at byte 31 = size + 1</text>
|
|
<text class="fg-note fg-note--l" x="420" y="227">incomplete: wait for more</text>
|
|
<text class="fg-note fg-note--l" x="16" y="267">chunk 5</text>
|
|
<rect class="nj-sax-old" x="93" y="250" width="255" height="24" rx="4"/>
|
|
<rect class="nj-sax-new" x="348" y="250" width="45" height="24" rx="4"/>
|
|
<text class="nj-sax-buf" x="96" y="267" xml:space="preserve">{"name": "Mary", "list": [1, 2, 3]}</text>
|
|
<text class="nj-sax-status nj-sax-s-ok" x="420" y="261">parsed, size 35</text>
|
|
<text class="fg-note fg-note--l" x="420" y="277">complete: one value</text>
|
|
<path class="nj-sax-sep" d="M16 290 H684"/>
|
|
<text class="fg-note fg-note--l" x="16" y="325">other input</text>
|
|
<rect class="nj-sax-new" x="96" y="308" width="45" height="24" rx="4"/>
|
|
<text class="nj-sax-buf" x="96" y="325" xml:space="preserve">[1, ]</text>
|
|
<path class="nj-sax-caret nj-sax-s-err" d="M133.8 334 l-5 8 h10 z"/>
|
|
<text class="nj-sax-status nj-sax-s-err" x="420" y="319">error at byte 5, size 5</text>
|
|
<text class="fg-note fg-note--l" x="420" y="335">before the end: a real error</text>
|
|
<text class="fg-note fg-note--l" x="16" y="366">Bytes parsed: 4 + 12 + 19 + 30 + 35 = 100 for a value of 35 bytes.</text>
|
|
<text class="fg-note fg-note--l" x="16" y="386">Every attempt starts again at byte 1, so the total work grows</text>
|
|
<text class="fg-note fg-note--l" x="16" y="406">quadratically with the size of the value.</text>
|
|
</svg>
|