realm / jazzy

Soulful docs for Swift & Objective-C
https://realm.io
MIT License
7.35k stars 413 forks source link

Not generate documentation in swift with jazzy #255

Closed ryujik closed 9 years ago

ryujik commented 9 years ago

Hi, I have a project test and I want generate document this project. Although show me success in console generate document jazzy, but not generate document for swift project. It's blank. I'm sure doing something wrong, but I don't know what. Do I need configure something? or Do I documenting wrong in my code? Please help me, about how use correctly jazzy. Thanks you for your help. (This example class is http://nshipster.com/swift-documentation/)

import Foundation

/// 🚲 A two-wheeled, human-powered mode of transportation.
class Bicycle {
    /**
    Frame and construction style.

    - Road: For streets or trails.
    - Touring: For long journeys.
    - Cruiser: For casual trips around town.
    - Hybrid: For general-purpose transportation.
    */
    enum Style {
        case Road, Touring, Cruiser, Hybrid
    }

    /**
    Mechanism for converting pedal power into motion.

    - Fixed: A single, fixed gear.
    - Freewheel: A variable-speed, disengageable gear.
    */
    enum Gearing {
        case Fixed
        case Freewheel(speeds: Int)
    }

    /**
    Hardware used for steering.

    - Riser: A casual handlebar.
    - Café: An upright handlebar.
    - Drop: A classic handlebar.
    - Bullhorn: A powerful handlebar.
    */
    enum Handlebar {
        case Riser, Café, Drop, Bullhorn
    }

    /// The style of the bicycle.
    let style: Style

    /// The gearing of the bicycle.
    let gearing: Gearing

    /// The handlebar of the bicycle.
    let handlebar: Handlebar

    /// The size of the frame, in centimeters.
    let frameSize: Int

    /// The number of trips travelled by the bicycle.
    private(set) var numberOfTrips: Int

    /// The total distance travelled by the bicycle, in meters.
    private(set) var distanceTravelled: Double

    /**
    Initializes a new bicycle with the provided parts and specifications.

    :param: style The style of the bicycle
    :param: gearing The gearing of the bicycle
    :param: handlebar The handlebar of the bicycle
    :param: centimeters The frame size of the bicycle, in centimeters

    :returns: A beautiful, brand-new, custom built just for you.
    */
    init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int) {
        self.style = style
        self.gearing = gearing
        self.handlebar = handlebar
        self.frameSize = centimeters

        self.numberOfTrips = 0
        self.distanceTravelled = 0
    }

    /**
    Take a bike out for a spin.

    :param: meters The distance to travel in meters.
    */
    func travel(distance meters: Double) {
        if meters > 0 {
            distanceTravelled += meters
            ++numberOfTrips
        }
    }
}

Show me this in terminal

Running xcodebuild
Parsing Person.swift (1/3)
Parsing ViewController.swift (2/3)
Parsing AppDelegate.swift (3/3)
building site
jam out ♪♫ to your fresh new docs in `docs`
ryujik commented 9 years ago

Apparently I solved put 'public' the class and methods, but these is correct?

segiddins commented 9 years ago

@ryujik yes, by default jazzy only documents public members. You can change this by passing the --min-acl flag, with an option of internal or private if you'd like to document those ACL levels as well.

douglastaquary commented 8 years ago

In my case, i did deleted /docs into project and run again jazzy --min-acl internal. Its work for me!

ashishkarna commented 8 years ago

jazzy --min-acl internal

Running xcodebuild Could not parse compiler arguments from xcodebuild output. Please confirm that xcodebuild is building a Swift module. Saved xcodebuild log file: /var/folders/0h/7_n82hbn4rxgr5ngmhvjgvd80000gp/T/xcodebuild-7A035436-70E9-4DE1-9124-A45056593C0A.log Failed to generate documentation /Library/Ruby/Gems/2.0.0/gems/jazzy-0.7.0/lib/jazzy/executable.rb:36:in `execute_command': /Library/Ruby/Gems/2.0.0/gems/jazzy-0.7.0/lib/jazzy/SourceKitten/bin/sourcekitten "doc", "--"

Running xcodebuild

Could not parse compiler arguments from xcodebuild output.

Please confirm that xcodebuild is building a Swift module.

Saved xcodebuild log file: /var/folders/0h/7_n82hbn4rxgr5ngmhvjgvd80000gp/T/xcodebuild-7A035436-70E9-4DE1-9124-A45056593C0A.log

Failed to generate documentation from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.7.0/lib/jazzy/sourcekitten.rb:147:in run_sourcekitten' from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.7.0/lib/jazzy/doc_builder.rb:64:inblock in build' from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.7.0/lib/jazzy/doc_builder.rb:62:in chdir' from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.7.0/lib/jazzy/doc_builder.rb:62:inbuild' from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.7.0/bin/jazzy:15:in <top (required)>' from /usr/local/bin/jazzy:23:inload' from /usr/local/bin/jazzy:23:in `

'

How to resolve this issue . Need help

douglastaquary commented 8 years ago

@ashishkarna You can try to delete the folder /docs into project and run again jazzy--min-acl internal.