WhisperCom/doc/docset/Makefile
Dominik Meyer cc002ebfbb Squashed 'libs/json/' content from commit f42a74b8
git-subtree-dir: libs/json
git-subtree-split: f42a74b8f53cc308647123d49d33d1c8122e3f42
2021-08-22 01:28:31 +02:00

22 lines
1.2 KiB
Makefile

nlohmann_json.docset: Info.plist docSet.sql
$(MAKE) clean
mkdir -p nlohmann_json.docset/Contents/Resources/Documents/
cp info.plist nlohmann_json.docset/Contents
# build and copy documentation
$(MAKE) build -C ../mkdocs
cp -r ../mkdocs/site/* nlohmann_json.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
# 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
# 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>|' {} +
# clean up
rm nlohmann_json.docset/Contents/Resources/Documents/hooks.py
rm nlohmann_json.docset/Contents/Resources/Documents/sitemap.*
# generate index
sqlite3 nlohmann_json.docset/Contents/Resources/docSet.dsidx < docSet.sql
clean:
rm -fr nlohmann_json.docset