1

所以我试图运行 Jazzy 来记录我的代码,但我并没有走得太远。

这就是当我在我用 swift 编写的 Xcode 项目上运行 Jazzy 时发生的事情(以及 @objc 中的一些函数)。我需要以任何方式准备项目吗?我找不到任何关于此的信息,但这是我第一次使用 Xcode 和 jazzy。谁能告诉我为什么它不能正常运行我在运行命令时做错了什么?

jazzy 
Running xcodebuild
Checking xcodebuild -showBuildSettings
Assuming New Build System is used.
Parsing AppDelegate.swift (1/4)
Parsing Card.swift (2/4)
Parsing SceneDelegate.swift (3/4)
Parsing ViewController.swift (4/4)
0% documentation coverage with 0 undocumented symbols
skipped 4 private, fileprivate, or internal symbols (use `--min-acl` to specify a different minimum ACL)
building site
building search index
jam out ♪♫ to your fresh new docs in `docs`

我尝试做 jazzy --min-acl 但发生了这种情况:

jazzy --min-acl
Traceback (most recent call last):
15: from /usr/local/bin/jazzy:23:in `<main>'
14: from /usr/local/bin/jazzy:23:in `load'
13: from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/bin/jazzy:15:in `<top (required)>'
12: from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/lib/jazzy/config.rb:442:in `parse!'
11: from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/lib/jazzy/config.rb:485:in   `parse_command_line'
10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/optparse.rb:1678:in `parse!'
 9: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/optparse.rb:1656:in `permute!'
 8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/optparse.rb:1562:in `order!'
 7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/optparse.rb:1568:in `parse_in_order'
 6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/optparse.rb:1568:in `catch'
 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/optparse.rb:1582:in `block in parse_in_order'
 4: from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/lib/jazzy/config.rb:54:in `block in attach_to_option_parser'
 3: from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/lib/jazzy/config.rb:35:in `set'
 2: from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/lib/jazzy/config.rb:35:in `instance_exec'
 1: from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/lib/jazzy/config.rb:342:in `block in <class:Config>'
 /Library/Ruby/Gems/2.6.0/gems/jazzy-0.13.2/lib/jazzy/source_declaration/access_control_level.rb:64:in `from_human_string': cannot initialize AccessControlLevel with '' (RuntimeError)
4

1 回答 1

0

为了人们在 google 上搜索,当 jazzy 报告跳过项目并生成 0% 的文档时,请按以下方式调用 jazzy:

jazzy --min-acl <internal|fileprivate|private>

除非您另外指定访问权限,否则 Swift 是内部的。

这是讨论该主题的 github 自述文件的链接:https ://github.com/realm/jazzy#controlling-what-is-documented

于 2020-07-13T14:48:07.213 回答