Jazzy is not working as expected for generating swift documentation

非 Y 不嫁゛ 提交于 2020-01-01 08:26:10

问题


After doing some research on the best way to document swift code. I came across Jazzy and how simple it was to implement. So I follow the installation section of the Jazzy Documentation. I run

sudo gem install jazzy

Then I navigate to the root of my project, in the terminal, and run jazzy which creates a folder called "docs" with a website that displays documentation for 1 class. I have 87 classes which I can visibly see jazzy looping through in the terminal output.

I've read the NSHipster Tutorial about documenting code which also links you to the Jazzy Documentation as well as the Markup Formatting Reference. I've documented some code, which Xcode displays correctly in the side pane or right clicking the function or class. So i'm fairly certain that my syntax is correct.

I took some time to compare that 1 file to the another file that isn't being displayed and I don't see anything out of the ordinary with regards to format.

I'm running:

  • jazzy version: 0.3.2
  • Xcode version: 7.1
  • Swift version: 2.1
  • OS X El Capitan Version: 10.11

My overall question is; Why isn't jazzy producing documentation for all classes and how can I fix this issue?


回答1:


After reading more about jazzy more in depth I found this important piece of information.

By default, jazzy only documents public declarations. To generate documentation for declarations with a lower accessibility level (internal or private), please set the --min-acl flag to internal or private.

Which is in the trouble shooting portion of the jazzy git hub page

I ran jazzy with the following line to produce the documentation i expected:

jazzy --min-acl private

Note I should read everything before I decided something isn't working right.




回答2:


To make it even better. Use
jazzy --min-acl internal --skip-undocumented
Explanation :
--min-acl internal this will include all functions, classes, structs in your documentary
--skip-undocumented this will ignore all undocumented classes...



来源:https://stackoverflow.com/questions/33533188/jazzy-is-not-working-as-expected-for-generating-swift-documentation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!