如何使用 jazzy 来记录我的 swift 项目?

Xin*_*gou 3 document ios swift jazzy

我想记录我的 swift 项目,我在 github 上找到了 jazzy。查看指南后,我创建了一个新的简单项目并想尝试一下,这是我ViewController的一些文档信息:

import UIKit
/**
a view controller
*/
class ViewController: UIViewController {
// MARK: property
/// a simple var
var hello = 200

// MARK: Func
/// view did load
override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    print(add(2, b: 2))
}
/// did receiveMemoryWarning
override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

/// a document test func
func add(a:Int, b:Int)->Int{
    return a + b
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的命令:

    ?  DocumentDemo git:(master) ? jazzy --swift-version 2.1.1 \
--clean \
--author helloworld \
-x -scheme,DocumentDemo
Running xcodebuild
Parsing ViewController.swift (1/3)
Parsing AppDelegate.swift (2/3)
Parsing My.swift (3/3)
building site
jam out ?? to your fresh new docs in `docs`
?  DocumentDemo git:(master) ?
Run Code Online (Sandbox Code Playgroud)

我希望 html 有一些关于我的视图控制器的信息,但结果没有:

在此处输入图片说明

我想知道如何使用 jazzy,希望得到一些建议。

Cal*_*ter 5

默认情况下,Jazzy 仅记录public类、函数、属性等。因此您可以执行以下两种操作之一:

  1. public关键字添加到您想要记录的类、方法和属性。
  2. 更改Jazzy 将记录的隐私级别。您可以使用--min-acl标志更改此设置:

    jazzy --swift-version 2.1.1 --min-acl=internal
    
    Run Code Online (Sandbox Code Playgroud)