📝 add offline pages for docset

parent 178125ff
...@@ -10,5 +10,11 @@ ...@@ -10,5 +10,11 @@
<string>json</string> <string>json</string>
<key>isDashDocset</key> <key>isDashDocset</key>
<true/> <true/>
<key>dashIndexFilePath</key>
<string>index.html</string>
<key>DashDocSetFallbackURL</key>
<string>https://nlohmann.github.io/json/</string>
<key>isJavaScriptEnabled</key>
<true/>
</dict> </dict>
</plist> </plist>
...@@ -2,6 +2,19 @@ nlohmann_json.docset: Info.plist docSet.sql ...@@ -2,6 +2,19 @@ nlohmann_json.docset: Info.plist docSet.sql
$(MAKE) clean $(MAKE) clean
mkdir -p nlohmann_json.docset/Contents/Resources/Documents/ mkdir -p nlohmann_json.docset/Contents/Resources/Documents/
cp info.plist nlohmann_json.docset/Contents 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 sqlite3 nlohmann_json.docset/Contents/Resources/docSet.dsidx < docSet.sql
clean: clean:
......
This diff is collapsed.
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
serve: prepare_files serve: prepare_files
venv/bin/mkdocs serve venv/bin/mkdocs serve
build: prepare_files
venv/bin/mkdocs build
# create files that are not versioned inside the mkdocs folder # create files that are not versioned inside the mkdocs folder
prepare_files: clean prepare_files: clean
# build Doxygen # build Doxygen
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment