From 5a5073dd2b16ee9c6f5707fc3b6a430659e1f9d1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 6 Nov 2021 22:36:25 +0100 Subject: [PATCH] :wrench: tweak MkDocs configuration --- .../docs/features/binary_formats/index.md | 2 +- .../docs/features/element_access/index.md | 2 +- doc/mkdocs/docs/features/parsing/index.md | 2 +- doc/mkdocs/docs/features/types/index.md | 2 +- doc/mkdocs/mkdocs.yml | 17 ++++++++++++----- doc/mkdocs/scripts/check_structure.py | 4 ++++ 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/doc/mkdocs/docs/features/binary_formats/index.md b/doc/mkdocs/docs/features/binary_formats/index.md index 279009d11..e115e02ba 100644 --- a/doc/mkdocs/docs/features/binary_formats/index.md +++ b/doc/mkdocs/docs/features/binary_formats/index.md @@ -1,4 +1,4 @@ -# Overview +# Binary Formats Though JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports diff --git a/doc/mkdocs/docs/features/element_access/index.md b/doc/mkdocs/docs/features/element_access/index.md index 1755fe8c6..0b39547ec 100644 --- a/doc/mkdocs/docs/features/element_access/index.md +++ b/doc/mkdocs/docs/features/element_access/index.md @@ -1,4 +1,4 @@ -# Overview +# Element Access There are many ways elements in a JSON value can be accessed: diff --git a/doc/mkdocs/docs/features/parsing/index.md b/doc/mkdocs/docs/features/parsing/index.md index 5cf59bfe9..29493520e 100644 --- a/doc/mkdocs/docs/features/parsing/index.md +++ b/doc/mkdocs/docs/features/parsing/index.md @@ -1,4 +1,4 @@ -# Overview +# Parsing !!! note diff --git a/doc/mkdocs/docs/features/types/index.md b/doc/mkdocs/docs/features/types/index.md index b2da9a911..f52d35558 100644 --- a/doc/mkdocs/docs/features/types/index.md +++ b/doc/mkdocs/docs/features/types/index.md @@ -1,4 +1,4 @@ -# Overview +# Types This page gives an overview how JSON values are stored and how this can be configured. diff --git a/doc/mkdocs/mkdocs.yml b/doc/mkdocs/mkdocs.yml index d1a01f743..539cc21fe 100644 --- a/doc/mkdocs/mkdocs.yml +++ b/doc/mkdocs/mkdocs.yml @@ -20,10 +20,13 @@ theme: accent: indigo font: text: Roboto - code: Roboto Mono + code: JetBrains Mono features: - - tabs - - instant + - navigation.instant + - navigation.tracking + - navigation.tabs + - navigation.indexes + - navigation.top nav: - Home: @@ -70,7 +73,7 @@ nav: - integration/cmake.md - integration/package_managers.md - integration/pkg-config.md - - API: + - API Documentation: - basic_json: - 'Overview': api/basic_json/index.md - '(Constructor)': api/basic_json/basic_json.md @@ -239,10 +242,13 @@ extra: link: https://www.xing.com/profile/Niels_Lohmann - icon: fontawesome/brands/paypal link: https://www.paypal.me/nlohmann + generator: false # Extensions markdown_extensions: + - abbr - admonition + - attr_list - def_list - codehilite: guess_lang: false @@ -274,7 +280,8 @@ markdown_extensions: plugins: - search: - separator: '[\s\-\.]+' + separator: '[\s\-\.]' + lang: en - minify: minify_html: true diff --git a/doc/mkdocs/scripts/check_structure.py b/doc/mkdocs/scripts/check_structure.py index a73f9b626..a256622a8 100644 --- a/doc/mkdocs/scripts/check_structure.py +++ b/doc/mkdocs/scripts/check_structure.py @@ -41,6 +41,10 @@ def check_structure(): for lineno, line in enumerate(file_content.readlines()): line = line.strip() + # Overview pages should have a better title + if line == '# Overview': + print(f'{file}:{lineno+1}: Error: overview pages should have a better title!') + # lines longer than 160 characters are bad (unless they are tables) if len(line) > 160 and '|' not in line: print(f'{file}:{lineno+1}: Error: line is too long ({len(line)} vs. 160 chars)!')