Shell script to convert ApiGen documentation to Xcode Documentation Set. Main purpose is to make ApiGen documentation available for Dash - snippet manager and documentation browser for OS X.
The script does the following operations:
- Creates docset bundle directory structure.
- Creates required bundle files (info.plist, nodes.xml, etc.).
- Removes unnecessary html fragments (left navigation menu) from documentation files and puts modified files to corresponding bundle subdirectory.
- Modifies documentation CSS file (to hide unnecessary search bar).
- Creates token XML file by searching index.html for class, interface, exception and function names.
- Converts token XML file to documentation index using docsetutil.
The script requires docsetutil installed in the following location: /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil
. Please adjust docsetutil
variable if you have Xcode tools installed in different location.
The script can convert documentation generated using ApiGen 2.6.1 and default template.
apigen2docset directory
You have to specify a directory where ApiGen documentation is located. Directory name is used as name for generated Docset bundle. Files in source directory are not modified.
./apigen2docset.sh ~/docs/Nette-API
will generate Nette-API.docset
bundle.
Screenshot of ApiGen documentation viewed using Dash - snippet manager and documentation browser for OS X.
I have already created some docsets for my personal usage. If you want, you can grab the following Dash feeds:
https://raw.github.com/hugo187/apigen2docset/master/feeds/Nette_Framework.xml
https://raw.github.com/hugo187/apigen2docset/master/feeds/Nette_Framework_Prefixed.xml
https://raw.github.com/hugo187/apigen2docset/master/feeds/Zend_Framework.xml