From bbdb29c6583e9e68f7f2bdce59a7384f061e0e32 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 1 Sep 2021 08:43:10 +0200 Subject: [PATCH] Update docset generation script (#2967) * :memo: update docset generation script * :memo: update documentation --- .gitignore | 9 ++---- README.md | 8 ++++-- doc/Doxyfile | 2 +- doc/Makefile | 22 +-------------- doc/docset/Makefile | 26 ++++++++++-------- doc/docset/README.md | 6 ++++ doc/docset/docset.json | 10 +++++++ doc/docset/icon.png | Bin 0 -> 700 bytes doc/docset/icon@2x.png | Bin 0 -> 1362 bytes .../docs/integration/package_managers.md | 6 +++- 10 files changed, 47 insertions(+), 42 deletions(-) create mode 100644 doc/docset/docset.json create mode 100644 doc/docset/icon.png create mode 100644 doc/docset/icon@2x.png diff --git a/.gitignore b/.gitignore index bf938c8ea..a46520789 100644 --- a/.gitignore +++ b/.gitignore @@ -12,10 +12,6 @@ build build_coverage clang_analyze_build -doc/xml -doc/html -me.nlohmann.json.docset - benchmarks/files/numbers/*.json .wsjcpp-logs/* @@ -27,10 +23,11 @@ benchmarks/files/numbers/*.json test/test-* /.vs +doc/html doc/mkdocs/venv/ doc/mkdocs/docs/images doc/mkdocs/docs/examples doc/mkdocs/site doc/mkdocs/docs/__pycache__/ -doc/xml -/doc/docset/nlohmann_json.docset/ +/doc/docset/JSON_for_Modern_C++.docset/ +/doc/docset/JSON_for_Modern_C++.tgz diff --git a/README.md b/README.md index 635f4655a..6cf9b5d4f 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Thanks everyone! :bug: If you found a **bug**, please check the [**FAQ**](https://json.nlohmann.me/home/faq/) if it is a known issue or the result of a design decision. Please also have a look at the [**issue list**](https://github.com/nlohmann/json/issues) before you [**create a new issue**](https://github.com/nlohmann/json/issues/new/choose). Please provide as many information as possible to help us understand and reproduce your issue. +There is also a [**docset**](https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B) for the documentation browsers [Dash](https://kapeli.com/dash), [Velocity](https://velocity.silverlakesoftware.com), and [Zeal](https://zealdocs.org) that contains the full [documentation](https://json.nlohmann.me) as offline resource. ## Examples @@ -1038,7 +1039,7 @@ auto cbor = json::to_msgpack(j); // 0xD5 (fixext2), 0x10, 0xCA, 0xFE Though it's 2021 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work: - GCC 4.8 - 11.0 (and possibly later) -- Clang 3.4 - 12.0 (and possibly later) +- Clang 3.4 - 13.0 (and possibly later) - Apple Clang 9.1 - 12.4 (and possibly later) - Intel C++ Compiler 17.0.2 (and possibly later) - Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later) @@ -1263,7 +1264,9 @@ If you are using [NuGet](https://www.nuget.org), you can use the package [nlohma If you are using [conda](https://conda.io/), you can use the package [nlohmann_json](https://github.com/conda-forge/nlohmann_json-feedstock) from [conda-forge](https://conda-forge.org) executing `conda install -c conda-forge nlohmann_json`. Please file issues [here](https://github.com/conda-forge/nlohmann_json-feedstock/issues). -If you are using [MSYS2](https://www.msys2.org/), your can use the [mingw-w64-nlohmann-json](https://packages.msys2.org/base/mingw-w64-nlohmann-json) package, just type `pacman -S mingw-w64-i686-nlohmann-json` or `pacman -S mingw-w64-x86_64-nlohmann-json` for installation. Please file issues [here](https://github.com/msys2/MINGW-packages/issues/new?title=%5Bnlohmann-json%5D) if you experience problems with the packages. +If you are using [MSYS2](https://www.msys2.org/), you can use the [mingw-w64-nlohmann-json](https://packages.msys2.org/base/mingw-w64-nlohmann-json) package, just type `pacman -S mingw-w64-i686-nlohmann-json` or `pacman -S mingw-w64-x86_64-nlohmann-json` for installation. Please file issues [here](https://github.com/msys2/MINGW-packages/issues/new?title=%5Bnlohmann-json%5D) if you experience problems with the packages. + +If you are using [MacPorts](https://ports.macports.org), execute `sudo port install nlohmann-json` to install the [nlohmann-json](https://ports.macports.org/port/nlohmann-json/) package. If you are using [`build2`](https://build2.org), you can use the [`nlohmann-json`](https://cppget.org/nlohmann-json) package from the public repository https://cppget.org or directly from the [package's sources repository](https://github.com/build2-packaging/nlohmann-json). In your project's `manifest` file, just add `depends: nlohmann-json` (probably with some [version constraints](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml#guide-add-remove-deps)). If you are not familiar with using dependencies in `build2`, [please read this introduction](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml). Please file issues [here](https://github.com/build2-packaging/nlohmann-json) if you experience problems with the packages. @@ -1592,6 +1595,7 @@ I deeply appreciate the help of the following people. - [Amir Masoud Abdol](https://github.com/amirmasoudabdol) updated the Homebrew command as nlohmann/json is now in homebrew-core. - [Hallot](https://github.com/Hallot) fixed some `-Wextra-semi-stmt warnings`. - [Giovanni Cerretani](https://github.com/gcerretani) fixed `-Wunused` warnings on `JSON_DIAGNOSTICS`. +- [Bogdan Popescu](https://github.com/Kapeli) hosts the [docset](https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B) for offline documentation viewers. Thanks a lot for helping out! Please [let me know](mailto:mail@nlohmann.me) if I forgot someone. diff --git a/doc/Doxyfile b/doc/Doxyfile index 6217d1b10..9f7d96a93 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -252,7 +252,7 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- # Configuration options related to the XML output #--------------------------------------------------------------------------- -GENERATE_XML = YES +GENERATE_XML = NO XML_OUTPUT = xml XML_PROGRAMLISTING = YES XML_NS_MEMB_FILE_SCOPE = NO diff --git a/doc/Makefile b/doc/Makefile index 9addd3401..761dd4368 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -43,7 +43,7 @@ check_output: $(EXAMPLES:.cpp=.test) clean: - rm -fr me.nlohmann.json.docset html xml $(EXAMPLES:.cpp=) + rm -fr me.nlohmann.json.docset html $(EXAMPLES:.cpp=) $(MAKE) clean -C docset $(MAKE) clean -C mkdocs @@ -70,23 +70,3 @@ upload: clean doxygen check_output scripts/git-update-ghpages nlohmann/json html rm -fr html open http://nlohmann.github.io/json/ - - -########################################################################## -# docset -########################################################################## - -# create docset for Dash -docset: create_output - cp Doxyfile Doxyfile_docset - $(SED) -i 's/DISABLE_INDEX = NO/DISABLE_INDEX = YES/' Doxyfile_docset - $(SED) -i 's/SEARCHENGINE = YES/SEARCHENGINE = NO/' Doxyfile_docset - $(SED) -i 's@HTML_EXTRA_STYLESHEET = css/mylayout.css@HTML_EXTRA_STYLESHEET = css/mylayout_docset.css@' Doxyfile_docset - rm -fr html *.docset - doxygen Doxyfile_docset - $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType >@@g' html/*.html - $(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType >@@g' html/*.html - make -C html - mv html/*.docset . - $(SED) -i 's@doxygen@json@' me.nlohmann.json.docset/Contents/Info.plist - rm -fr Doxyfile_docset html diff --git a/doc/docset/Makefile b/doc/docset/Makefile index 262540a0c..e538661ec 100644 --- a/doc/docset/Makefile +++ b/doc/docset/Makefile @@ -1,21 +1,25 @@ -nlohmann_json.docset: Info.plist docSet.sql +JSON_for_Modern_C++.docset: Info.plist docSet.sql $(MAKE) clean - mkdir -p nlohmann_json.docset/Contents/Resources/Documents/ - cp info.plist nlohmann_json.docset/Contents + mkdir -p JSON_for_Modern_C++.docset/Contents/Resources/Documents/ + cp icon*.png JSON_for_Modern_C++.docset + cp Info.plist JSON_for_Modern_C++.docset/Contents # build and copy documentation $(MAKE) build -C ../mkdocs - cp -r ../mkdocs/site/* nlohmann_json.docset/Contents/Resources/Documents + cp -r ../mkdocs/site/* JSON_for_Modern_C++.docset/Contents/Resources/Documents # patch CSS to hide navigation items - echo "\n\nheader, footer, navi, div.md-sidebar--primary, nav.md-tabs--active, a.md-content__button { display: none; }" >> nlohmann_json.docset/Contents/Resources/Documents/assets/stylesheets/main.b5d04df8.min.css + echo "\n\nheader, footer, navi, div.md-sidebar--primary, nav.md-tabs--active, a.md-content__button { display: none; }" >> "$$(ls JSON_for_Modern_C++.docset/Contents/Resources/Documents/assets/stylesheets/main.*.min.css)" # fix spacing - echo "\n\ndiv.md-sidebar div.md-sidebar--secondary, div.md-main__inner { top: 0; margin-top: 0 }" >> nlohmann_json.docset/Contents/Resources/Documents/assets/stylesheets/main.b5d04df8.min.css + echo "\n\ndiv.md-sidebar div.md-sidebar--secondary, div.md-main__inner { top: 0; margin-top: 0 }" >> "$$(ls JSON_for_Modern_C++.docset/Contents/Resources/Documents/assets/stylesheets/main.*.min.css)" # remove "JSON for Modern C++" from page titles - find nlohmann_json.docset/Contents/Resources/Documents -type f -exec gsed -i 's| - JSON for Modern C++||' {} + + find JSON_for_Modern_C++.docset/Contents/Resources/Documents -type f -exec gsed -i 's| - JSON for Modern C++||' {} + # clean up - rm nlohmann_json.docset/Contents/Resources/Documents/hooks.py - rm nlohmann_json.docset/Contents/Resources/Documents/sitemap.* + rm JSON_for_Modern_C++.docset/Contents/Resources/Documents/hooks.py + rm JSON_for_Modern_C++.docset/Contents/Resources/Documents/sitemap.* # generate index - sqlite3 nlohmann_json.docset/Contents/Resources/docSet.dsidx < docSet.sql + sqlite3 JSON_for_Modern_C++.docset/Contents/Resources/docSet.dsidx < docSet.sql + +JSON_for_Modern_C++.tgz: JSON_for_Modern_C++.docset + tar --exclude='.DS_Store' -cvzf JSON_for_Modern_C++.tgz JSON_for_Modern_C++.docset clean: - rm -fr nlohmann_json.docset + rm -fr JSON_for_Modern_C++.docset JSON_for_Modern_C++.tgz diff --git a/doc/docset/README.md b/doc/docset/README.md index b0dd7f81e..79a778eb8 100644 --- a/doc/docset/README.md +++ b/doc/docset/README.md @@ -11,3 +11,9 @@ make nlohmann_json.docset ``` The generated folder `nlohmann_json.docset` can then be opened in the documentation browser. + +A recent version is also part of the [Dash user contributions](https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B). + +## Licenses + +The [JSON logo](https://commons.wikimedia.org/wiki/File:JSON_vector_logo.svg) is public domain. diff --git a/doc/docset/docset.json b/doc/docset/docset.json new file mode 100644 index 000000000..f8d478302 --- /dev/null +++ b/doc/docset/docset.json @@ -0,0 +1,10 @@ +{ + "name": "JSON for Modern C++", + "version": "3.10.0", + "archive": "JSON_for_Modern_C++.tgz", + "author": { + "name": "Niels Lohmann", + "link": "https://twitter.com/nlohmann" + }, + "aliases": ["nlohmann/json"] +} diff --git a/doc/docset/icon.png b/doc/docset/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7197d0a7549bc0768c3aec04c499527af0964ab8 GIT binary patch literal 700 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YDR+ueoXe|!I#{Xiaj ziKnkC`%?~aJ}Jgs;g1a&7#NRux;TbtoM$~~nIRI$(D1PS`Pp|e?|nD9?-AP2p|U~I z*M;dLi*n{At|qaK0@|+=J~**#G>X;I7St7yzP&+#O|dCSF(XU3xjJR;-S79_OqJcQ z&#Y%4@X+;tT7hSu`^%Giji;`h?!J8=Z+k`yx6HIX?e{JxI6hm-!P@#{%kDdRW&2+r zQIO#~zDfFDuBeui2$yT$zLN9hYHyD>3OZk}ese#l<%wjv%GUr%SBJKgV?Vy0_1Q6{ zR#;4Rb4=oz!0K&p-Bxc}aAKpsjJmnY7nK>)r$iyl7 zFuD8n-Kq$gU-3^h*UMZ!lrX0)cxkWe<;v^(UuPBaWrnCKna57{zWsL-|s2l<@v#1c6ZzLx$~pW0;5>9#5JNMC9x#cD!C{X zNHG{07#ZpsSm+uVhZvez8JSucnrIssSQ!|Ye1DdOq9HdwB{QuOw+7c$ao2zv7(8A5 KT-G@yGywoMt{y)C literal 0 HcmV?d00001 diff --git a/doc/docset/icon@2x.png b/doc/docset/icon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5f2fac87aabddaa6fcbf29ce239ff9e992e624c0 GI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bT~-p&9A@X2CnYBDSTUUzZnjmP_Q6WD^iYrE}9zjMotL-;t@ z6y|^Hdrarb)OGy;001R)MObuXVRU6WV{&C-bY%cCFfuVMFgPtTGgL7&Ix;mnF*GYM zFgh?WH23Ce0000bbVXQnWMOn=I&E)cX=Zr$G&(XhIx#dWFfckW UFh#0f)&Kwi07*qoM6N<$g4-^5B>(^b literal 0 HcmV?d00001 diff --git a/doc/mkdocs/docs/integration/package_managers.md b/doc/mkdocs/docs/integration/package_managers.md index aba070984..a4eda83f6 100644 --- a/doc/mkdocs/docs/integration/package_managers.md +++ b/doc/mkdocs/docs/integration/package_managers.md @@ -160,7 +160,11 @@ If you are using [conda](https://conda.io/), you can use the package [nlohmann_j ## MSYS2 -If you are using [MSYS2](http://www.msys2.org/), your can use the [mingw-w64-nlohmann-json](https://packages.msys2.org/base/mingw-w64-nlohmann-json) package, just type `pacman -S mingw-w64-i686-nlohmann-json` or `pacman -S mingw-w64-x86_64-nlohmann-json` for installation. Please file issues [here](https://github.com/msys2/MINGW-packages/issues/new?title=%5Bnlohmann-json%5D) if you experience problems with the packages. +If you are using [MSYS2](http://www.msys2.org/), you can use the [mingw-w64-nlohmann-json](https://packages.msys2.org/base/mingw-w64-nlohmann-json) package, just type `pacman -S mingw-w64-i686-nlohmann-json` or `pacman -S mingw-w64-x86_64-nlohmann-json` for installation. Please file issues [here](https://github.com/msys2/MINGW-packages/issues/new?title=%5Bnlohmann-json%5D) if you experience problems with the packages. + +## MacPorts + +If you are using [MacPorts](https://ports.macports.org), execute `sudo port install nlohmann-json` to install the [nlohmann-json](https://ports.macports.org/port/nlohmann-json/) package. ## build2