如何将方法描述的 XML 注释保留在单独的文件中?
这个问题源于这个问题 代码文档多少算太多?
答案之一是保留您的 xml 文档位于单独的文件中。 我真的很喜欢这个答案,因为当我查看代码时,文档的冗长很烦人,另一方面,当通过智能感知搜索正确的方法或发布文档时,冗长的内容很有用。
答案是使用 include 标签
/// <include file="Documentation/XML/YourClass.xml" path="//documentation/members[@name='YourClass']/*"/>
还有一篇关于 include 标签的 MSDN 文章 这里。
我想出了如何保留摘要信息,但我不知道,也找不到如何将方法文档放在那里。 (这比课堂总结本身更重要。
This question stems from this question
Code documentation how much is too much?
One the answers was to keep your xml documentation in a separate file. I really liked that answer as when I am looking through the code the verbosity of the documentation is annoying, on the other hand that verbosity is usefull when searching for the right method via intellisense or publishing the documentation.
The answer was to use the include tag
/// <include file="Documentation/XML/YourClass.xml" path="//documentation/members[@name='YourClass']/*"/>
There is also a MSDN article about the include tag here.
I figured out how to keep the summary information out, but I do not know and I couldn't find it how to put the method documentation there as well. (which is more important than the class summary itself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案很简单。 读取生成的 xml 文件。 他们给出了分离的 xml 文件应该是什么样子的想法。
读取生成的 xml 文件以及如何描述方法(带有参数等):
T、M、F 前缀类型、方法、字段。
The answer is simple. Read the produced xml files. They give an idea how the separated xml files should look like.
Reading the produced xml files and how method is described (with parameters and such):
T, M, F prefixes Type, Method, Field.