2015-12-24 56 views
2

我想記錄我的swift項目,並在github上找到爵士樂。 一看指南後,我創建了一個新的簡單的項目,並希望有一個嘗試,這裏是我的ViewController一些文檔信息:如何使用爵士來記錄我的swift項目?

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有關於我的視圖控制器的一些信息,但結果是什麼也沒有:

enter image description here

我想知道如何使用爵士樂,希望得到一些建議。

+0

搜索在GitHub上wiki和爵士的問題;有幾個陷阱。此外,Jazzy還有一個「默認訪問控制級別」的可見性,如果我沒有記錯,它就是「public」(不是默認的「protected」);這就是爲什麼你的文檔最終會空虛,我想。 –

+0

@NicolasMiari我試圖公開,這個問題,非常感謝 – Xingou

+2

Mmh ...你嘗試使用配置文件(.jazzy.yaml)嗎?我從'clean:true \ nmin_acl:private'開始。這意味着任何以上 - 包括私人都被記錄在案。 –

回答

2

默認情況下,爵士只有文件public類,功能,性能等,所以你可以做兩件事情之一:

  1. 添加public關鍵字類,方法和屬性你想要 文件。
  2. Change the privacy level Jazzy將文件。您可以更改 這與--min-acl標誌:

    jazzy --swift-version 2.1.1 --min-acl=internal 
    
1

在SWIFT 3只

jazzy --min-acl=internal 
0

是的,如果你只是運行jazzy,爵士只是假設你想默認的訪問控制水平是public

所以除非我們用public註解,最後的文檔不會顯示論文。默認級別是internal


提示

您可以創建一個.jazzy.yaml,並把配置在那裏。所以在這之後,可以運行。

$ jazzy

爵士將解析我們的配置YAML文件中。

參考:Siesta's jazzy

相關問題