英文:
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将使用来自编译器如swiftc和clang的符号图数据。
默认情况下,编译器将从所有公共符号生成它。当为应用程序生成文档时,我们可以将其配置为内部。
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论