Add parameter summary to hostclass html docs

Format cribbed from YARD method and attribute summary blocks. Still some work
to do, but initial results don't look that bad.
This commit is contained in:
Charlie Sharpsteen 2014-05-30 08:58:17 -07:00
parent 005a8521bd
commit d0d943436e
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,18 @@
<h2>Parameter Summary<small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">
<% object.parameters.each do |param| %>
<li>
<a href="#">
<span class="summary_signature">
-
<strong><%= h param[0] %></strong>
<% unless param[1].nil? %>
<%# TODO: Linkify defaults that resolve to variable declarations in a different scope. %>
=> <%= h param[1] %>
<% end %>
</span>
<%# TODO: Grab onto @param tags and insert text/type. %>
</a>
</li>
<% end %>
</ul>

View File

@ -1,7 +1,12 @@
include T('default/module')
def init
sections :header, :box_info, :pre_docstring, T('docstring'), :subclasses
sections :header, :box_info, :pre_docstring, T('docstring'), :parameter_details, :subclasses
end
def parameter_details
return if object.parameters.empty?
erb(:parameter_details)
end
def subclasses