summaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authortakahashim <[email protected]>2015-10-11 23:29:06 +0900
committertakahashim <[email protected]>2015-10-12 12:45:48 +0900
commit4d1b7420a4aaaaa8da14091d95ed007f4efb93ab (patch)
tree6fe4bf91ffad6f97cc431f9f7d0ebb811c76b1fa /templates
parent815138042c845a74ac17dbd308f43713815c9fd8 (diff)
downloadyard-mruby-4d1b7420a4aaaaa8da14091d95ed007f4efb93ab.tar.gz
yard-mruby-4d1b7420a4aaaaa8da14091d95ed007f4efb93ab.zip
support typedef documentation
cf. #2 * add TypedefObject * add TypedefHandler for parser * generate Typedef documents in C header files
Diffstat (limited to 'templates')
-rw-r--r--templates/default/header/html/setup.rb8
-rw-r--r--templates/default/header/html/typedef_summary.erb11
2 files changed, 19 insertions, 0 deletions
diff --git a/templates/default/header/html/setup.rb b/templates/default/header/html/setup.rb
index 204f823..7bb0159 100644
--- a/templates/default/header/html/setup.rb
+++ b/templates/default/header/html/setup.rb
@@ -5,6 +5,7 @@ def init
sections :header, :pre_docstring, T('docstring'), :includes,
:function_summary, [:item_summary],
:define_summary, [T('docstring')],
+ :typedef_summary, [T('docstring')],
:function_details_list, [T('function_details')]
end
@@ -22,3 +23,10 @@ def define_listing
@defines = object.defines
@defines
end
+
+def typedef_listing
+ return @typedefs if @typedefs
+
+ @typedefs = object.typedefs
+ @typedefs
+end
diff --git a/templates/default/header/html/typedef_summary.erb b/templates/default/header/html/typedef_summary.erb
new file mode 100644
index 0000000..001ab2d
--- /dev/null
+++ b/templates/default/header/html/typedef_summary.erb
@@ -0,0 +1,11 @@
+<% if typedef_listing.size > 0 %>
+ <h2>Typedef Summary</h2>
+ <dl class="constants">
+ <% typedef_listing.each do |typedef| %>
+ <dt id="<%= anchor_for(typedef) %>" class="<%= typedef.has_tag?(:deprecated) ? 'deprecated' : '' %>"><small>typedef</small> <%= typedef.name %>
+ <%= yieldall :object => typedef %>
+ </dt>
+ <dd><pre class="code"><%#= format_constant typedef.value %></pre></dd>
+ <% end %>
+ </dl>
+<% end %>