Slide 1

Slide 1 text

jazzy github.com/realm/jazzy a soulful way to generate docs for Swift & Objective-C

Slide 2

Slide 2 text

Instead of parsing your source files, jazzy hooks into clang/SourceKit and uses the AST representation of your code and its comments for more accurate results.

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

How do you USE it?

Slide 5

Slide 5 text

$ [sudo] gem install jazzy

Slide 6

Slide 6 text

$ jazzy

Slide 7

Slide 7 text

$ jazzy • Grabs all the *.swift files from your main target and builds docs for them • Target & destination are configurable... more coming • Outputs static site in docs/ by default

Slide 8

Slide 8 text

Design goals • Generate source code docs matching Apple's official reference documentation • Support for Xcode and Dash docsets • High readability of source code comments • Leverage modern HTML templating (Mustache) • Let Clang/SourceKit do all the heavy lifting • Compatibility with appledoc when possible

Slide 9

Slide 9 text

Doxygen (ObjC-style) /** Lorem ipsum dolor sit amet. @param bar Consectetur adipisicing elit. @return Sed do eiusmod tempor. */ func foo(bar: String) -> AnyObject { ... }

Slide 10

Slide 10 text

Restructured Text (ReST) /** Lorem ipsum dolor sit amet. :param: bar Consectetur adipisicing elit. :returns: Sed do eiusmod tempor. */ func foo(bar: String) -> AnyObject { ... }

Slide 11

Slide 11 text

Getting there

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

SourceKit

Slide 14

Slide 14 text

SourceKitten github.com/jpsim/SourceKitten 1. Swift code highlighting 2. Swift interface generation from ObjC headers 3. Generate Swift docs from Swift source 4. Swift code highlighting 5. USR generation

Slide 15

Slide 15 text

Resources • jazzy: github.com/realm/jazzy • appledoc: github.com/tomaz/appledoc • swift doc syntax: nshipster.com/swift-documentation • SourceKit: jpsim.com/uncovering-sourcekit • SourceKitten: github.com/jpsim/SourceKitten

Slide 16

Slide 16 text

CocoaHeads().questions?.askThem!

Slide 17

Slide 17 text

JP Simard, @simjp, realm.io