Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Appledocs to generate documentation

I apologize for the simplicity of my question, but I was trying to generate documentation using Appledocs (https://github.com/tomaz/appledoc#quick-install)

I'm not sure how exactly to get it setup. The way I do it is:

  • I clone the github repo and then install appledocs using the install script (I confirm this using appledocs --help) in the terminal.

However, now how do I actually use this in the sense that I have my project in xcode:

  • how do I generate the documentation file
  • where is it generated?
like image 631
David West Avatar asked Mar 04 '13 16:03

David West


People also ask

What is appledoc?

appledoc is command line tool that helps Objective-C developers generate Apple-like source code documentation from specially formatted source code comments.

How do I use DocC in Xcode?

To do this in your own project, right-click on your package's directory in the project navigator, then choose New File. If you scroll down to the Documentation section you'll see Documentation Catalog – select that and click Next, and Xcode will create the catalog for you immediately.

What is DocC?

DocC syntax — called documentation markup — is a custom variant of Markdown that adds functionality for developer documentation-specific features, like cross-symbol linking, term-definition lists, code listings, and asides.


1 Answers

What I always do is add a new target to my project which can generate documentation. You can go to your project build phases and click on 'Add Target'. Choose Aggregate under Other and give it some name (e.g. ProjectDocumentation).

Still on the build phases tab go to 'Add build phase' and click 'Add run script'. You can now paste the following and adjust it to your own settings:

/usr/local/bin/appledoc \
--project-name HereProjectName \
--project-company "HereProjectCompany" \
--company-id com.companyName \
--keep-undocumented-objects \
--keep-undocumented-members \
--search-undocumented-doc \
--exit-threshold 2 \
--ignore .m \
--output "AppleDoc" .

I use the ignore *.m because I only only write documentation in my header files. Documentation in my *.m files is for myself only (and thus private). When you build this target, the documentation is generated as a XCode docset. This is accessible by alt-click on a class name. Check out the AppleDoc website for commenting syntax.

For explanation of the command-line options checkout the appledoc --help command.

like image 165
Robin van Dijke Avatar answered Sep 29 '22 18:09

Robin van Dijke