mirror of
https://github.com/nlohmann/json.git
synced 2026-10-27 16:28:57 +00:00
- 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>
35 lines
1.5 KiB
HTML
35 lines
1.5 KiB
HTML
{#- Home page: the brand's blue hero band below the tabs (selected with "template: home.html" in index.md) -#}
|
|
{% extends "main.html" %}
|
|
|
|
{% block tabs %}
|
|
{{ super() }}
|
|
<section class="nj-hero">
|
|
<div class="nj-hero__inner md-grid">
|
|
<div class="nj-hero__text">
|
|
<h1 class="nj-hero__title">JSON for <span>Modern C++</span></h1>
|
|
<p class="nj-hero__lead">What if JSON was part of modern C++?</p>
|
|
<p class="nj-hero__actions">
|
|
<a href="{{ 'integration/' | url }}" class="md-button md-button--primary nj-hero__button">Get started</a>
|
|
<a href="{{ 'api/basic_json/' | url }}" class="md-button nj-hero__button">API documentation</a>
|
|
<a href="{{ 'home/releases/v3.12.0/' | url }}" class="md-button nj-hero__button">Latest release</a>
|
|
</p>
|
|
</div>
|
|
<div class="nj-hero__code" aria-hidden="true">
|
|
<pre><code><span class="nj-k">#include</span> <span class="nj-s"><iostream></span>
|
|
<span class="nj-k">#include</span> <span class="nj-s"><nlohmann/json.hpp></span>
|
|
|
|
<span class="nj-k">using</span> json = nlohmann::json;
|
|
|
|
<span class="nj-k">int</span> main()
|
|
{
|
|
json j = json::parse(<span class="nj-s">R"({"happy": true})"</span>);
|
|
j[<span class="nj-s">"pi"</span>] = <span class="nj-n">3.141</span>;
|
|
j[<span class="nj-s">"list"</span>] = {<span class="nj-n">1</span>, <span class="nj-n">0</span>, <span class="nj-n">2</span>};
|
|
|
|
std::cout << j.dump(<span class="nj-n">4</span>) << <span class="nj-s">"\n"</span>;
|
|
}</code></pre>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %}
|