Introduction:
Appledoc is a helper tool that can help you generate objective-c code annotations, and Appledoc generates a comment API document that is consistent with the Apple Class Library's API documentation.
This allows Xcode to recognize our own API documentation.
Reference:
1:mac Installing Brew
http://blog.csdn.net/chenyi8888/article/details/7345113
2: Document Generation tool using Objective-c: Appledoc
http://blog.devtang.com/blog/2012/02/01/use-appledoc-to-generate-xcode-doc/
Mac Installation Brew
sudo brew install wget
If you uninstall, the command is as follows:
sudo brew uninstall wget
To view the installation software, the command is as follows:
sudo brew search/apache*/
Note that/apache*/is used for regular expressions, used/split.
Installation:
Appledoc 's GitHub escrow address is as follows:
Https://github.com/tomaz/appledoc
This edition uses Brew to install Appledoc
Command:sudo brew install Appledoc
If you do not install brew in advance, then the above command will certainly expire.
Install brew using the following command:
Command: CURL-LSSF http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz-c/usr/local --strip 1
Note the path of the red flag in the command above.
You should check to see if you have this path, as shown in:
If not, manually create one later, after performing the Install Brew command.
Check if brew is installed successfully.
Command:Brew
If a bunch of brew instructions are present, then the installation is successful.
Next go back to our Appledoc and run the following command:
Command:sudo brew install Appledoc
It is still possible to fail in the execution of the command. The reason is that the specified path does not have sufficient read and write permissions.
/usr/local/bin is not writable. You should the change of its permissions.
Then go to the path in red flag to set read and write permissions for it
When finished, uninstall Appledoc at this time. At this point the Appledoc is installed half, not completely installed successfully.
Command:brew Uninstall Appledoc
Once the installation is finished, re-execute it again.
No accident, the installation should be successful.
Then the same test, whether the installation is successful, bring up the Appledoc help document.
Command:appledoc--help
Use:
Generate API documentation with the following command
[CSharp]View Plaincopy
- Appledoc--project-name yushuyi12345677
- --project-company "xiaoyu123"
- --company-id AAAA
- --output/users/yushuyi/desktop
- /users/yushuyi/desktop/multiftptask/multiftptask/classes
Note: Each of the above commands is required to provide 5 parameters, respectively:
1: Project name
2: Company Name
3: Project ID
4: Generate result output path
5: Scan the class under which path.
The command iterates through all the classes according to the specified path, and when the build succeeds, Appledoc creates a new text file to record the build, which is stored in the--output specified in the command above.
When executing the above command, make sure that all newline characters are deleted after the execution.
The resulting document is automatically stored in the Xcode default document directory:
~/library/developer/shared/documentation/docsets
Without an accident, you can see the document that was generated after the command was just executed in the directory:
We all know that when you hold option , click a method or property name
Document Generation tool using Objective-c: Appledoc
Feb 1st, 2012
Objective
The number of people doing the project requires documentation. Try to write some project documents today. But in terms of source code, the document is best and source together, so update more convenient and handy. Like the Java language itself comes with the Javadoc command, you can extract documents from the source code. Today took time to investigate similar tools for the Objective-c language.
Three more popular tools were found on StackOverflow: Doxygen, Headdoc and Appledoc. Their respective official web sites are as follows:
- Docxygen http://www.stack.nl/~dimitri/doxygen/index.html
- Headdoc http://developer.apple.com/opensource/tools/headerdoc.html
- Appledoc http://gentlebytes.com/appledoc/
Introduced
I have a look at all 3 tools, and say how I feel.
Docxygen
Docxygen feeling is that the 3 tools support the most languages, can be configured in more places. I probably looked at the document, I thought it was more complicated, and the default generated style was inconsistent with Apple's style. I went to see the introduction of the 2 tools in the back. In addition, although it is open source software, but did not put the source on GitHub to make me feel that the development of this tool is not enough activity.
Headerdoc
Headerdoc is a document generation tool that comes with Xcode. After you install Xcode, you can use the command line: headdoc2html + source file name to generate the corresponding document. I have a personal trial, or relatively convenient, but the Headerdoc annotation generation rules are very special, only generated to/*! */The format of the comment. Another disadvantage is that each class file corresponds to a comment file, there is no summary of the file, this feeling a bit uncomfortable.
Appledoc
Appledoc is an annotation tool that is recommended by everyone on the StackOverflow. There are several reasons why I like it better:
- Its default generated document style is consistent with Apple's official documentation, and Doxygen needs to be configured separately.
- Appledoc is generated with objective-c, the necessary time to debug and change is also more convenient.
- Docset can be generated and integrated into Xcode. This is great, equivalent to holding down option in the source code and then clicking to bring up the appropriate method of help.
- Appledoc source is on GitHub, and Doxygen is on SVN. I personally think that more active open source projects should be on GitHub.
- Compared to Headerdoc, it has no special annotation requirements, can be used in/** */format, can also be compatible with/*! */In the format of the comment, and the resulting comment has a summary page.
Installation
So a simple introduction to how to install Appledoc, installation is very simple, only need 2 steps:
123 |
git clone git://github.com/tomaz/appledoc.git cd appledoc sudo sh install-appledoc.sh
|
Use
When using Appledoc, you only need to use the following command:
1 |
appledoc -o ./doc --project-name ynote --project-company youdao .
|
Appledoc scans all files under the current path, and then generates a good document to be placed in the doc directory. You can also use Appledoc-help to view all available parameters.
Basically it is easy to use, detailed information can be viewed in the official documentation: http://gentlebytes.com/appledoc/
03-Open Source framework: Appledoc