1. 安裝AppleDoc
cd ~/Downloads/ && git clone git://github.com/tomaz/appledoc.git && cd ./appledoc && sudo sh install-appledoc.sh
可以通過 appledoc --help 檢視相關指令
2.生成docset
appledoc --output ./docset --docset-install-path ./docset --project-name "AppleDoc" --project-company "xyz" --project-version "1.0.0" --no-warn-undocumented-object --no-warn-undocumented-member ./AppleDoc
#--output 輸出目錄; --project-name 工程名;--project-version 版本号;--project-company 公司名;
#--no-warn-undocumented-member 沒有屬性和方法的檔案不提示; ./AppleDoc 需要生成代碼文檔的目錄
PS:生成的html就在 docset/x.docset/Contents/Resources/Documents 目錄下
Github位址:https://github.com/chenzhe555/iOS-AppleDoc