【问题标题】:How to copy .NET API documentation?如何复制 .NET API 文档?
【发布时间】:2023-04-04 21:39:01
【问题描述】:

如果一个类实现了接口中定义的方法,您可以选择是复制文档还是使用<see cref="..." /> 引用它。

public interface IPerformer
{
    /// <summary>
    /// Do something useful.
    /// </summary>
    /// <param name="something">Object to do something with</param>
    void Do(Something something);
}

public class Implementation : IPerformer
{
    /// <copy from="IPerformer" /> # that is what I want!
    public void Do(Something something)
    {
        // implementation ...
    }
}

是否可以让 API 文档工具 (Sandcastle) 自动复制文档(如何让阅读 API 文档更舒适)? Java Doc 中的 @inheritDoc 之类的东西?

【问题讨论】:

    标签: c# .net documentation sandcastle api-doc


    【解决方案1】:

    不是您正在寻找的答案,但GhostDoc 可以为您做到这一点。它会将 cmets 从接口拉到实现中。

    【讨论】:

      【解决方案2】:

      Sandcastle Help File Builder (SHFB) 通过inheritdoc tag 提供此功能。

      【讨论】:

        【解决方案3】:

        Jetbrain 的 Resharper 允许您从接口复制 cmets(或者当您从接口创建实例时,它会自动为您复制它们),但是如果您更新接口的注释,则必须删除 cmets 并再次从 base 复制 cmets !

        【讨论】:

          【解决方案4】:

          AtomineerUtils Pro Documentation 将自动为您复制基类、接口和重载文档。 (它类似于 GhostDoc,但它是一个更强大且可配置的文档生成器)。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2019-04-23
            • 2018-07-09
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2010-09-05
            • 1970-01-01
            相关资源
            最近更新 更多