2021-09-01 14:43:10 +08:00
|
|
|
JSON_for_Modern_C++.docset: Info.plist docSet.sql
|
2020-08-13 16:52:20 +08:00
|
|
|
$(MAKE) clean
|
2021-09-01 14:43:10 +08:00
|
|
|
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
|
2020-08-13 19:35:05 +08:00
|
|
|
# build and copy documentation
|
|
|
|
$(MAKE) build -C ../mkdocs
|
2021-09-01 14:43:10 +08:00
|
|
|
cp -r ../mkdocs/site/* JSON_for_Modern_C++.docset/Contents/Resources/Documents
|
2020-08-13 19:35:05 +08:00
|
|
|
# patch CSS to hide navigation items
|
2021-09-01 14:43:10 +08:00
|
|
|
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)"
|
2020-08-13 19:35:05 +08:00
|
|
|
# fix spacing
|
2021-09-01 14:43:10 +08:00
|
|
|
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)"
|
2020-08-13 19:35:05 +08:00
|
|
|
# remove "JSON for Modern C++" from page titles
|
2021-09-01 14:43:10 +08:00
|
|
|
find JSON_for_Modern_C++.docset/Contents/Resources/Documents -type f -exec gsed -i 's| - JSON for Modern C++</title>|</title>|' {} +
|
2020-08-13 19:35:05 +08:00
|
|
|
# clean up
|
2021-09-01 14:43:10 +08:00
|
|
|
rm JSON_for_Modern_C++.docset/Contents/Resources/Documents/sitemap.*
|
2020-08-13 19:35:05 +08:00
|
|
|
# generate index
|
2021-09-01 14:43:10 +08:00
|
|
|
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
|
2020-08-13 16:52:20 +08:00
|
|
|
|
|
|
|
clean:
|
2021-09-01 14:43:10 +08:00
|
|
|
rm -fr JSON_for_Modern_C++.docset JSON_for_Modern_C++.tgz
|