-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Documentation with AppleDoc #351
Comments
Hmm. That's a new one to me. Spent several minutes looking for example output linked somewhere from the page. Apple uses headerdoc, but with a lot of custom styling. The default output is awful. I've used Doxygen in the past and can't really recommend it. |
I think that whichever style is chosen for Cocos2D, we should stick with whatever clang understands and parses best. In order for documentation not to become outdated quickly, I find that letting Xcode spit out warnings for documentation errors very useful. [web [iPhone msg]]
|
I gave Appledoc a quick run, and the output you get is already very useful (but it can certainly be improved with better formatted headers). |
I use AppleDoc and VVDocumenter. I still think it is a disgrace to spam the header with all this. It should go in the implementation. |
Hmm. Sounds like people have really liked AppleDoc then. (still haven't taken the time to try it yet) Does it really allow you to doc the implementation instead of the header? That sounds mildly attractive. IMO headers should at least have one line descriptions for things, but I do agree that headers are not the place to write a full description. It makes them very hard to use as a reference. |
Yeah, it allows for the documentation in the implementation. Docs in the headers, is a "well it is better than nothing" solution, which has then become a standard. It is a disaster, as a slightly commented, well formatted and spaced up header, can give you a one-shot view of what the class will do. Which functions do I have, to create an menuItem with a call back selector? The header is where you should look for that … or of course a dedicated manual, but I do not think we are there yet. Den Oct 18, 2013 kl. 11:40 PM skrev slembcke notifications@github.com:
|
It is pretty much standard to have the generated API documentation in the header files. What goes in the implementation files should only be documentation related to the specifics of the implementation. There are several reasons for this. For one, the idea with the header file is that you should be able to exchange the implementation without changing anything that is visible from the outside. Also, developers that are using a static library will not be able to look for the docs in the .m files. Also, most people will not look for any documentation in the .m files. The fine side with adding automated documentation using Appledoc is that you can get your one shot quick overview right in the Xcode docs (or even by option clicking keywords etc). |
I've now added support for Appledoc on the develop-v3 branch. It's super easy to try out for those who wants. Just open the cocos2d-ios.xcodeproj and select the 'appledoc' target and build. All documentation files (including html) will be generated to the api-docs directory of cocos2d-iphone and the docset should also be installed in Xcode.You may need to restart Xcode to be able to use the new docs. There are quite a few warnings outputted by Appledoc, but the output still doesn't look super bad. There are some minor changes we may need to do code-wise, like changing typedef enum to use NS_ENUM (which may be a good thing to do either way). |
Tested to add properly formatted documentation to one of the header files: |
Did an update to the original post! |
Martin and I will be going over the header files, and update anything we can find. For now we will coordinate amongst our selves, who is doing what. |
I mentioned this elsewhere, but let me mention it again. |
Agreed, I'm all for removing them. As we aren't providing a migration path from v2, maybe we should also take the chance to clear out the deprecated file too. |
+1 for clearing the deprecated file 👍 |
The majority of core cocos2d files are now documented, we are leaving support files for now however there are a few that I think are very useful so will document these, CGPointExtension for example is incredibly useful however judging by the forum, most users don't even know it exists. Any others? |
While I'm looking at the current doc warnings, I've tweaked a few and started on CCPhysics however these also need looked at: CCNode |
Have made a pull request for Physics, appledocs now generate with zero warnings which is nice. |
Looking over the docs, there is definitely still work to do here:
I think we still need someone to go through every single page and make sure they look good, are grammatically correct and is up-to-date. |
Presume the commented out headers will be redundant (or base classes etc) at some point in the near future? So don't need to waste time tweaking documentation on them?
|
Found a bug in AppleDoc generator! This problem has been annoying me for a while, in the documentation there was a constant and page simply called ','. Turns out that if you use an enumeration with a type that is not just a single word it breaks. For example:
Have just changed to NSUInteger, can't see any issues with that? Can always typedef an unsigned char if need be. |
Oh! I forgot to push those changes from my other computer. I fixed that a few days ago. :-\ Apparently we made the same change though. |
I noticed that a lot of properties in CCButton, are not documented? |
OK an update to documentation status. Have worked through loads in my last pull request, about 1,700 changes heh. Still need to review: CCActionCatmullRom @Birkemose Would you mind adding a little intro to CCScene about scene/nodes etc |
UPDATE:
We have chosen to go with AppleDoc. Some things to keep in mind while doing API docs:
UPDATE 2: Some more points to take into consideration:
More descriptive would be:
Old post follows:
I suggest using Appledoc to document the next version of Cocos2d. A big advantage is that it is easy to integrate with Xcode. When documentation is installed, the user can just option click a class/property and get immediate information about how it works, it also shows up in the documentation browser.
More info on Appledoc here: http://gentlebytes.com/appledoc/ and a tutorial here: http://www.cocoanetics.com/2011/11/amazing-apple-like-documentation/
Before we start and split up the work, we need to agree on a common coding and formatting style for the header files.
The text was updated successfully, but these errors were encountered: