问题
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