我想记录我的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
}
}下面是我的命令:
➜ 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) ✗我希望html有一些关于我的视图控制器的信息,但结果是什么都没有:

我想知道如何使用jazzy,希望有一些建议。
发布于 2017-01-03 21:50:50
默认情况下,Jazzy只记录public类、函数、属性等,因此您可以做以下两件事之一:
在你想要document.
public将被记录下来。您可以使用--min-acl标志来更改此设置:jazzy --swift-版本2.1.1 --min-acl=internal
发布于 2017-03-10 01:01:12
在swift 3上
jazzy --min-acl=internal发布于 2017-11-06 18:33:40
是的,如果你只运行jazzy,jazzy就假设你想要默认的访问控制级别是public。
因此,除非我们使用public注释内容,否则最终文档不会显示这些内容。默认级别为internal。
提示
您可以创建一个.jazzy.yaml,并将配置放入其中。所以在这之后,就可以直接运行了。
$ jazzy
Jazzy将解析我们配置的yaml文件。
https://stackoverflow.com/questions/34450117
复制相似问题