summaryrefslogtreecommitdiffhomepage
path: root/templates/default/header
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-25 13:12:22 -0300
committerSeba Gamboa <[email protected]>2015-09-25 13:12:22 -0300
commit48fb10fef522ab9262061bc612b44d74a8bda17d (patch)
treec48dcb77245e4a6b15af4366e96c31d6eb1cdd93 /templates/default/header
parente0e43a79d282d69f2f45d5cf71e0e1154357d181 (diff)
downloadyard-mruby-48fb10fef522ab9262061bc612b44d74a8bda17d.tar.gz
yard-mruby-48fb10fef522ab9262061bc612b44d74a8bda17d.zip
Listing functions
Diffstat (limited to 'templates/default/header')
-rw-r--r--templates/default/header/html/function_details_list.erb7
-rw-r--r--templates/default/header/html/function_summary.erb16
-rw-r--r--templates/default/header/html/includes.erb1
-rw-r--r--templates/default/header/html/item_summary.erb19
-rw-r--r--templates/default/header/html/pre_docstring.erb1
-rw-r--r--templates/default/header/html/setup.rb10
6 files changed, 45 insertions, 9 deletions
diff --git a/templates/default/header/html/function_details_list.erb b/templates/default/header/html/function_details_list.erb
new file mode 100644
index 0000000..37a9cc8
--- /dev/null
+++ b/templates/default/header/html/function_details_list.erb
@@ -0,0 +1,7 @@
+<div id="functions_details" class="method_details_list">
+ <h2>Function Details</h2>
+
+ <% function_listing.each_with_index do |func, i| %>
+ <%= yieldall :object => func, :owner => object, :index => i %>
+ <% end %>
+</div>
diff --git a/templates/default/header/html/function_summary.erb b/templates/default/header/html/function_summary.erb
index 037daa4..f37f075 100644
--- a/templates/default/header/html/function_summary.erb
+++ b/templates/default/header/html/function_summary.erb
@@ -1,6 +1,12 @@
-<ul class="summary">
+<% if function_listing.size > 0 %>
+ <h2>
+ Function Summary
+ <small><a href="#" class="summary_toggle">collapse</a></small>
+ </h2>
- <% function_listing.each do |func| %>
- <%= yieldall :item => func %>
- <% end %>
-</ul>
+ <ul class="summary">
+ <% function_listing.each do |func| %>
+ <%= yieldall :item => func %>
+ <% end %>
+ </ul>
+<% end %>
diff --git a/templates/default/header/html/includes.erb b/templates/default/header/html/includes.erb
new file mode 100644
index 0000000..6731e2b
--- /dev/null
+++ b/templates/default/header/html/includes.erb
@@ -0,0 +1 @@
+Included heaers
diff --git a/templates/default/header/html/item_summary.erb b/templates/default/header/html/item_summary.erb
new file mode 100644
index 0000000..522a3a1
--- /dev/null
+++ b/templates/default/header/html/item_summary.erb
@@ -0,0 +1,19 @@
+<li class="<%= @item.visibility %> <%= @item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
+ <span class="summary_signature">
+ <%= fsignature(@item, true, false) %>
+
+ <% if @item.aliases.size > 0 %>
+ (also: <%= @item.aliases.map {|o| h(o.name(true)) }.join(", ") %>)
+ <% end %>
+ </span>
+ <% if @item.visibility != :public %><span class="note title <%= @item.visibility %>"><%= @item.visibility %></span><% end %>
+ <% if @item.has_tag?(:abstract) %><span class="abstract note title">abstract</span><% end %>
+ <% if @item.has_tag?(:deprecated) %><span class="deprecated note title">deprecated</span><% end %>
+ <% if @item.has_tag?(:api) && @item.tag(:api).text == 'private' %><span class="private note title">private</span><% end %>
+
+ <% if @item.has_tag?(:deprecated) %>
+ <span class="summary_desc"><strong>Deprecated.</strong> <%= htmlify_line @item.tag(:deprecated).text %></span>
+ <% else %>
+ <span class="summary_desc"><%= htmlify_line docstring_summary(@item) %></span>
+ <% end %>
+</li>
diff --git a/templates/default/header/html/pre_docstring.erb b/templates/default/header/html/pre_docstring.erb
new file mode 100644
index 0000000..f3475da
--- /dev/null
+++ b/templates/default/header/html/pre_docstring.erb
@@ -0,0 +1 @@
+<h2>Overview</h2>
diff --git a/templates/default/header/html/setup.rb b/templates/default/header/html/setup.rb
index 6e5f8f9..52eb81c 100644
--- a/templates/default/header/html/setup.rb
+++ b/templates/default/header/html/setup.rb
@@ -1,8 +1,10 @@
-def init
- super
+include T('default/module')
+include YARD::MRuby::Templates::Helpers::HTMLHelper
- sections.push :header
- sections.push :function_summary
+def init
+ sections :header, :pre_docstring, T('docstring'), :includes,
+ :function_summary, [:item_summary],
+ :function_details_list, [T('function_details')]
end