Swift Doc-C – 文档中的选择性数据

huangapple go评论63阅读模式
英文:

Swift Doc-C - Selective data for documentation

问题

是不是可以选择特定的类或结构用于文档?目前,当我使用doc-c命令行托管我的静态网站时,它会拉取所有公共方法以供文档使用。
是否可以选择我代码中哪些文件夹需要用于文档目的?
任何链接、视频或示例都将不胜感激。

提前感谢!

英文:

Is it possible to select specific classes or structs for documentation ? As of now when I hosted my static website using doc-c command line it pulled up all the public methods for the sake of documentation.
Is it possible that I can select what folders within my code needs to be pulled up for documentation purpose ?
Any link , video, example will be highly appreciated

Thanks in advance

答案1

得分: 0

DocC将使用来自编译器如swiftcclang符号图数据。

默认情况下,编译器将从所有公共符号生成它。当为应用程序生成文档时,我们可以将其配置为内部

TL,DR:

如果你不想将你的公共符号记录在文档中,你可以使用@_documentation(visibility: private)

英文:

DocC will use symbol graph data from compilers like swiftc and clang.

By default, compiler will generate it from all public symbols. And we can config it to internal when generating documentation for an app.

TL,DR:

If you do not want your public symbol to be documented. You can use @_documentation(visibility: private)

For the full context, you can check the following forums posts and Swift documentation for Underscored Attributes.

https://forums.swift.org/t/nodoc-attribute-for-hiding-symbols-from-the-symbol-graph/59227

https://github.com/apple/swift/blob/main/docs/ReferenceGuides/UnderscoredAttributes.md#_documentationvisibility-

huangapple
  • 本文由 发表于 2023年7月20日 19:37:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76729453.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定