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:
parent
005a8521bd
commit
d0d943436e
|
@ -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>
|
|
@ -1,7 +1,12 @@
|
||||||
include T('default/module')
|
include T('default/module')
|
||||||
|
|
||||||
def init
|
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
|
end
|
||||||
|
|
||||||
def subclasses
|
def subclasses
|
||||||
|
|
Loading…
Reference in New Issue