mirror of
https://github.com/nlohmann/json.git
synced 2026-10-26 15:58:55 +00:00
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>
34 lines
1.4 KiB
HTML
34 lines
1.4 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>
|
|
</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 %}
|