summaryrefslogtreecommitdiffhomepage
path: root/templates/default
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-28 18:44:47 -0300
committerSeba Gamboa <[email protected]>2015-09-28 18:44:47 -0300
commite30672f239c42734b7b72a81c7d64bb809d5b7a2 (patch)
treee5ec9301fbe89e4b8157eb54457c1a31532720d4 /templates/default
parent73326c64a5e720f7d31b1e52ef9fda341895e800 (diff)
downloadyard-mruby-e30672f239c42734b7b72a81c7d64bb809d5b7a2.tar.gz
yard-mruby-e30672f239c42734b7b72a81c7d64bb809d5b7a2.zip
Defines template base
Diffstat (limited to 'templates/default')
-rw-r--r--templates/default/header/html/define_summary.erb11
-rw-r--r--templates/default/header/html/setup.rb8
2 files changed, 19 insertions, 0 deletions
diff --git a/templates/default/header/html/define_summary.erb b/templates/default/header/html/define_summary.erb
new file mode 100644
index 0000000..d4f28e8
--- /dev/null
+++ b/templates/default/header/html/define_summary.erb
@@ -0,0 +1,11 @@
+<% if define_listing.size > 0 %>
+ <h2>Define Summary</h2>
+ <dl class="constants">
+ <% define_listing.each do |define| %>
+ <dt id="<%= anchor_for(define) %>" class="<%= define.has_tag?(:deprecated) ? 'deprecated' : '' %>"><small>#define</small> <%= define.name %>
+ <%= yieldall :object => define %>
+ </dt>
+ <dd><pre class="code"><%#= format_constant define.value %></pre></dd>
+ <% end %>
+ </dl>
+<% end %>
diff --git a/templates/default/header/html/setup.rb b/templates/default/header/html/setup.rb
index 52eb81c..7ce1143 100644
--- a/templates/default/header/html/setup.rb
+++ b/templates/default/header/html/setup.rb
@@ -4,6 +4,7 @@ include YARD::MRuby::Templates::Helpers::HTMLHelper
def init
sections :header, :pre_docstring, T('docstring'), :includes,
:function_summary, [:item_summary],
+ :define_summary, [T('docstring')],
:function_details_list, [T('function_details')]
end
@@ -15,3 +16,10 @@ def function_listing
@funcs
end
+def define_listing
+ return @defines if @defines
+
+ @defines = object.defines
+ puts @defines.inspect
+ @defines
+end