Created
March 3, 2016 08:43
-
-
Save agrison/3298495b2264ef08a257 to your computer and use it in GitHub Desktop.
Create a Dash dockset from ricostacruz.com/cheatsheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download it all | |
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--restrict-file-names=windows \ | |
--domains ricostacruz.com \ | |
--no-parent \ | |
ricostacruz.com/cheatsheets/ | |
# install dashing | |
go get -u github.com/technosophos/dashing | |
# prepare the docset | |
cd ricostacruz.com/cheatsheets | |
dashing create | |
# I don't know why but dashing keeps creating a dashing.docset | |
dashing build ricostacruz-cheatsheets | |
mv dashing.docset ricostacruz-cheatsheets.docset | |
# copy resource where Dash expects it to be | |
cp -r ../til ricostacruz-cheatsheets.docset/Contents/Resources | |
# overwrite the plist to change the docset name to "ricostacruz-cheatsheets" and shortcut to "ricostacruz" and enable Javascript. | |
cat <<EOF > ricostacruz-cheatsheets.docset/Contents/Info.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleIdentifier</key> | |
<string>ricostacruz-cheatsheets</string> | |
<key>CFBundleName</key> | |
<string>ricostacruz-cheatsheets</string> | |
<key>DocSetPlatformFamily</key> | |
<string>ricostacruz</string> | |
<key>isDashDocset</key> | |
<true/> | |
<key>DashDocSetFamily</key> | |
<string>dashtoc</string> | |
<key>dashIndexFilePath</key> | |
<string>index.html</string> | |
<key>isJavaScriptEnabled</key> | |
<true/> | |
</dict> | |
</plist> | |
EOF | |
# Load the file ricostacruz-cheatsheets.docset into Dash and you're good to go. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment