您可以使用
XML样式的注释,并使用工具将这些注释引入API文档.
原文链接:https://www.f2er.com/php/140102.html这是一个评论风格的例子:
/// <summary> /// Authenticates a user based on a username and password. /// </summary> /// <param name="username">The username.</param> /// <param name="password">The password.</param> /// <returns> /// True,if authentication is successful,otherwise False. /// </returns> /// <remarks> /// For use with local systems /// </remarks> public override bool Authenticate(string username,string password)
有些项目是为了促进这一点:
GhostDoc,它为单个快捷键提供一个类或方法自动生成注释.
Sandcastle,它从XML注释生成MSDN样式文档.