use*_*882 3 ruby documentation ruby-on-rails yard ruby-on-rails-3
I am using Ruby on Rails 3.1.0 and I am trying to use YARD 0.7.4. I would like to document constant values, so in my class I state this:
# [Fixnum] Test constant documentation.
TEST_CONSTANT = 1
Run Code Online (Sandbox Code Playgroud)
but the HTML output after I run the yardoc
(or yard doc
) command is the following:
In the above image is shown that the HTML documentation is not good rendered/generated, at least not as I would expect. I read the YAML documentation but I still have some problem on that: how can I better state and display documentation related to constant values?
我也遇到了这个问题,谷歌给了我这个未答复的帖子。我在另一个论坛中找到了 Loren Segal(Yard 的创建者)的答案:link_to_forum。出于完整性原因,我为遇到同样问题的人添加了这个:
您可以像记录任何其他对象一样记录它。只需在常量上方添加注释即可。
# Documentation here
TEST_CONSTANT = 1
Run Code Online (Sandbox Code Playgroud)
请注意,至少对我而言,结果格式看起来有点奇怪。它首先格式化常量的名称,然后显示描述和值。我希望首先是描述,然后是名称和值。
归档时间: |
|
查看次数: |
159 次 |
最近记录: |