I wrote a little python script that takes the CHM formatted API documentation and converts it into DocSet format that can be used by Dash. If you don’t know it already, Dash is an nice offline documentation browser on Mac, which integrates with pretty much any source editor and supports most standard language APIs out of the box.
The result is one click access to the documentation from Xcode and instant fuzzy search from everywhere:
If anyone from Epic is reading this, would you mind if I uploaded the resulting docset somewhere, GitHub maybe? Considering that the API docs are publicly available online, this shouldn’t be a big problem? If you don’t want it to be public, is there a way to only share it with subscribers?
Also, if I may recommend a small improvement to the documentation in the future:
Some HTML meta info in the documentation would make parsing more easy and reliable. At the very least, a category (class, struct, method, constant etc…) for each file. Right now, I have to guess the category with a regexp match on the content of the div with class=‘simplecode_api’.
Until then (or if I’m not allowed to share the documentation itself), I put the script onto on GitHub. Here is how you use it:
- Get the CHM documentation from:
Windows: C:\Program Files\Unreal Engine\4.x\Engine\Documentation
- Extract the CHM file to HTML. You should get a folder that looks something like this:
The script uses BeautifulSoup to parse the documentation. If you don’t have it already, install it:
[FONT=Courier New]$ easy_install beautifulsoup4
Run the python script to generate the Dash compatible DocSet from the extracted HTML documentation:
[FONT=Courier New]$ python ue4docset.py -n “Unreal Engine” ~/Desktop/API ~/Desktop/UE4.docset
The first path is the location of the extracted HTML documentation. The second path is the output DocSet file. You can define the name of the documentaion as it will appear in Dash, using the -n option.
The process will take some time to parse the entire documentation. On my relatively fast machine it takes around 7 minutes to finish.
Go to Dash > Preferences > Docsets. Click the + button and add select the generated .docset file.
Xcode’s own documentation browser is not (yet) supported, as it uses a slightly more complicated format and I’m using Dash personally. I don’t have a lot of time for that right now, but if anyone wants to tackle that, just submit a pull request and I’ll merge it, thanks! Here is some info on Xcode’s format.