CocoaDocs Developer Docs

What is CocoaDocs?

CocoaDocs parses every CocoaPod and generates Documentation and statistics on the library.

Styling my Library

  • You have the ability to edit the styling of CocoaDocs for your own libraries to give some personal branding. This is done by adding a .cocoadocs.yml file to the root of your library, such as those shown below. You can easily create one of your own with the styling editor on the left and immediately see the results reflected here.

    highlight-font: '"GT Walsheim", "gt_walsheim_regular", "Avant Garde Gothic ITCW01Dm", "Avant Garde", "Helvetica Neue", "Arial"'
    
    body: '"Helvetica Neue", "Arial", san-serif'
    code: '"Monaco", "Menlo", "Consolas", "Courier New", monospace'
    
    highlight-color: '#ED0015'
    highlight-dark-color: '#A90010'
    
    darker-color: '#C6B7B2'
    darker-dark-color: '#A8A8A8'
    
    background-color: '#F2F2F2'
    alt-link-color: '#B7233F'
    warning-color: '#B80E3D'
    

    All defaults are stored in this config file for you to overwite.

  • You can find an example of styling at ARAnalytics's .cocoadocs.yml

Documentation Pages

  • You can add your own documentation guides, either from remote markdown files or from files locally inside the library. CocoaDocs will automatically convert github wiki pages to the markdown behind it.

    additional_guides:
         - https://github.com/magicalpanda/MagicalRecord/wiki/Installation
         - https://github.com/CocoaPods/CocoaPods/wiki/A-pod-specification
         - docs/Getting_started.md
    
  • If you host your own documentation, and/or just prefer to not use CocoaDocs you can use the documentation_url reference in your Podspec.

How can I find out generated stats for my library?

Send a get request (open your browser) to:

http://cocoadocs.org/docsets/[Podname]/[Version]/stats.json

How can I force a reparse of my library?

Send a get request (open your browser) to:

http://api.cocoadocs.org:4567/redeploy/[Podname]/[Version]

or

http://api.cocoadocs.org:4567/redeploy/[Podname]/latest

Please be cautious with this, it's a very time-expensive call. You'll get a JSON response saying whether parsing has started.

How can I find out if something went wrong?

Send a get request (open your browser) to:

http://api.cocoadocs.org:4567/error/[Podname]/[Version]

Previewing my library in CocoaDocs

First, clone this repo: git clone https://github.com/CocoaPods/cocoadocs.org then run bundle install you will need a working copy of appledoc ( which you can get a binary version from their github releases page as compiling doesn't work in Xcode 5.1+. )

To preview your library run:

bundle exec ./cocoadocs.rb preview ARAnalytics

This will get the master version of your library and run it through CocoaDocs, then open the resulting folder, you can open the index.html in a web browser to preview locally.

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6