mirror of
https://github.com/nlohmann/json.git
synced 2026-04-23 00:09:28 +00:00
Update docset generation script (#2967)
* 📝 update docset generation script * 📝 update documentation
This commit is contained in:
@@ -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
|
||||
|
||||
22
doc/Makefile
22
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@<string>doxygen</string>@<string>json</string>@' me.nlohmann.json.docset/Contents/Info.plist
|
||||
rm -fr Doxyfile_docset html
|
||||
|
||||
@@ -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++</title>|</title>|' {} +
|
||||
find JSON_for_Modern_C++.docset/Contents/Resources/Documents -type f -exec gsed -i 's| - JSON for Modern C++</title>|</title>|' {} +
|
||||
# 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
|
||||
|
||||
@@ -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.
|
||||
|
||||
10
doc/docset/docset.json
Normal file
10
doc/docset/docset.json
Normal file
@@ -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"]
|
||||
}
|
||||
BIN
doc/docset/icon.png
Normal file
BIN
doc/docset/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 700 B |
BIN
doc/docset/icon@2x.png
Normal file
BIN
doc/docset/icon@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user