如何在 rdoc 中显示常量值



是否有可能让 rdoc 也显示常量的值,而不仅仅是它的注释?目前它正在生成

Constants
DEFAULT_CONFIG_FILE
    Default configuration file location

我想要得到的是

Constants
DEFAULT_CONFIG_FILE = '~/config.yaml'
    Default configuration file location

给定源代码

DEFAULT_CONFIG_FILE = '~/config.yaml'

我怎样才能做到这一点?

您必须创建自定义模板。

这是模板中仅显示名称的违规行。您必须添加对 const.value 的引用。

也许像这样简单:

<dt id="<%= const.name %>"><%= const.name %> = <%= const.value %>

最新更新