yard 0.9.29 → 0.9.30
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of yard might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/docs/CodeObjects.md +115 -0
- data/docs/GettingStarted.md +679 -0
- data/docs/Handlers.md +152 -0
- data/docs/Overview.md +61 -0
- data/docs/Parser.md +191 -0
- data/docs/Tags.md +283 -0
- data/docs/TagsArch.md +123 -0
- data/docs/Templates.md +496 -0
- data/docs/WhatsNew.md +1245 -0
- data/docs/images/code-objects-class-diagram.png +0 -0
- data/docs/images/handlers-class-diagram.png +0 -0
- data/docs/images/overview-class-diagram.png +0 -0
- data/docs/images/parser-class-diagram.png +0 -0
- data/docs/images/tags-class-diagram.png +0 -0
- data/docs/templates/default/fulldoc/html/full_list_tag.erb +9 -0
- data/docs/templates/default/fulldoc/html/setup.rb +6 -0
- data/docs/templates/default/layout/html/setup.rb +9 -0
- data/docs/templates/default/layout/html/tag_list.erb +11 -0
- data/docs/templates/default/yard_tags/html/list.erb +18 -0
- data/docs/templates/default/yard_tags/html/setup.rb +26 -0
- data/docs/templates/plugin.rb +70 -0
- data/lib/yard/version.rb +1 -1
- data/po/ja.po +31108 -0
- data/templates/default/class/dot/setup.rb +7 -0
- data/templates/default/class/dot/superklass.erb +3 -0
- data/templates/default/class/html/constructor_details.erb +8 -0
- data/templates/default/class/html/setup.rb +2 -0
- data/templates/default/class/html/subclasses.erb +4 -0
- data/templates/default/class/setup.rb +36 -0
- data/templates/default/class/text/setup.rb +12 -0
- data/templates/default/class/text/subclasses.erb +5 -0
- data/templates/default/constant/text/header.erb +11 -0
- data/templates/default/constant/text/setup.rb +4 -0
- data/templates/default/docstring/html/abstract.erb +4 -0
- data/templates/default/docstring/html/deprecated.erb +1 -0
- data/templates/default/docstring/html/index.erb +5 -0
- data/templates/default/docstring/html/note.erb +6 -0
- data/templates/default/docstring/html/private.erb +4 -0
- data/templates/default/docstring/html/returns_void.erb +1 -0
- data/templates/default/docstring/html/text.erb +1 -0
- data/templates/default/docstring/html/todo.erb +6 -0
- data/templates/default/docstring/setup.rb +52 -0
- data/templates/default/docstring/text/abstract.erb +2 -0
- data/templates/default/docstring/text/deprecated.erb +2 -0
- data/templates/default/docstring/text/index.erb +2 -0
- data/templates/default/docstring/text/note.erb +4 -0
- data/templates/default/docstring/text/private.erb +2 -0
- data/templates/default/docstring/text/returns_void.erb +1 -0
- data/templates/default/docstring/text/text.erb +1 -0
- data/templates/default/docstring/text/todo.erb +4 -0
- data/templates/default/fulldoc/html/css/common.css +1 -0
- data/templates/default/fulldoc/html/css/full_list.css +58 -0
- data/templates/default/fulldoc/html/css/style.css +497 -0
- data/templates/default/fulldoc/html/frames.erb +17 -0
- data/templates/default/fulldoc/html/full_list.erb +37 -0
- data/templates/default/fulldoc/html/full_list_class.erb +2 -0
- data/templates/default/fulldoc/html/full_list_file.erb +7 -0
- data/templates/default/fulldoc/html/full_list_method.erb +10 -0
- data/templates/default/fulldoc/html/js/app.js +314 -0
- data/templates/default/fulldoc/html/js/full_list.js +216 -0
- data/templates/default/fulldoc/html/js/jquery.js +4 -0
- data/templates/default/fulldoc/html/setup.rb +241 -0
- data/templates/default/layout/dot/header.erb +6 -0
- data/templates/default/layout/dot/setup.rb +15 -0
- data/templates/default/layout/html/breadcrumb.erb +11 -0
- data/templates/default/layout/html/files.erb +11 -0
- data/templates/default/layout/html/footer.erb +5 -0
- data/templates/default/layout/html/headers.erb +15 -0
- data/templates/default/layout/html/index.erb +2 -0
- data/templates/default/layout/html/layout.erb +24 -0
- data/templates/default/layout/html/listing.erb +4 -0
- data/templates/default/layout/html/objects.erb +32 -0
- data/templates/default/layout/html/script_setup.erb +4 -0
- data/templates/default/layout/html/search.erb +13 -0
- data/templates/default/layout/html/setup.rb +89 -0
- data/templates/default/method/html/header.erb +17 -0
- data/templates/default/method/setup.rb +4 -0
- data/templates/default/method/text/header.erb +1 -0
- data/templates/default/method_details/html/header.erb +3 -0
- data/templates/default/method_details/html/method_signature.erb +25 -0
- data/templates/default/method_details/html/source.erb +10 -0
- data/templates/default/method_details/setup.rb +11 -0
- data/templates/default/method_details/text/header.erb +10 -0
- data/templates/default/method_details/text/method_signature.erb +12 -0
- data/templates/default/method_details/text/setup.rb +11 -0
- data/templates/default/module/dot/child.erb +1 -0
- data/templates/default/module/dot/dependencies.erb +3 -0
- data/templates/default/module/dot/header.erb +6 -0
- data/templates/default/module/dot/info.erb +14 -0
- data/templates/default/module/dot/setup.rb +15 -0
- data/templates/default/module/html/attribute_details.erb +10 -0
- data/templates/default/module/html/attribute_summary.erb +8 -0
- data/templates/default/module/html/box_info.erb +43 -0
- data/templates/default/module/html/children.erb +8 -0
- data/templates/default/module/html/constant_summary.erb +17 -0
- data/templates/default/module/html/defines.erb +3 -0
- data/templates/default/module/html/header.erb +5 -0
- data/templates/default/module/html/inherited_attributes.erb +14 -0
- data/templates/default/module/html/inherited_constants.erb +8 -0
- data/templates/default/module/html/inherited_methods.erb +19 -0
- data/templates/default/module/html/item_summary.erb +40 -0
- data/templates/default/module/html/method_details_list.erb +9 -0
- data/templates/default/module/html/method_summary.erb +14 -0
- data/templates/default/module/html/methodmissing.erb +12 -0
- data/templates/default/module/html/pre_docstring.erb +1 -0
- data/templates/default/module/setup.rb +167 -0
- data/templates/default/module/text/children.erb +10 -0
- data/templates/default/module/text/class_meths_list.erb +8 -0
- data/templates/default/module/text/extends.erb +8 -0
- data/templates/default/module/text/header.erb +7 -0
- data/templates/default/module/text/includes.erb +8 -0
- data/templates/default/module/text/instance_meths_list.erb +8 -0
- data/templates/default/module/text/setup.rb +13 -0
- data/templates/default/onefile/html/files.erb +5 -0
- data/templates/default/onefile/html/headers.erb +6 -0
- data/templates/default/onefile/html/layout.erb +17 -0
- data/templates/default/onefile/html/readme.erb +3 -0
- data/templates/default/onefile/html/setup.rb +62 -0
- data/templates/default/root/dot/child.erb +3 -0
- data/templates/default/root/dot/setup.rb +6 -0
- data/templates/default/root/html/setup.rb +2 -0
- data/templates/default/tags/html/example.erb +11 -0
- data/templates/default/tags/html/index.erb +3 -0
- data/templates/default/tags/html/option.erb +24 -0
- data/templates/default/tags/html/overload.erb +14 -0
- data/templates/default/tags/html/see.erb +8 -0
- data/templates/default/tags/html/tag.erb +20 -0
- data/templates/default/tags/setup.rb +57 -0
- data/templates/default/tags/text/example.erb +12 -0
- data/templates/default/tags/text/index.erb +1 -0
- data/templates/default/tags/text/option.erb +20 -0
- data/templates/default/tags/text/overload.erb +19 -0
- data/templates/default/tags/text/see.erb +11 -0
- data/templates/default/tags/text/tag.erb +13 -0
- data/templates/guide/class/html/setup.rb +2 -0
- data/templates/guide/docstring/html/setup.rb +2 -0
- data/templates/guide/fulldoc/html/css/style.css +108 -0
- data/templates/guide/fulldoc/html/js/app.js +33 -0
- data/templates/guide/fulldoc/html/setup.rb +74 -0
- data/templates/guide/layout/html/layout.erb +81 -0
- data/templates/guide/layout/html/setup.rb +25 -0
- data/templates/guide/method/html/header.erb +18 -0
- data/templates/guide/method/html/setup.rb +22 -0
- data/templates/guide/module/html/header.erb +7 -0
- data/templates/guide/module/html/method_list.erb +5 -0
- data/templates/guide/module/html/setup.rb +27 -0
- data/templates/guide/onefile/html/files.erb +4 -0
- data/templates/guide/onefile/html/setup.rb +6 -0
- data/templates/guide/onefile/html/toc.erb +3 -0
- data/templates/guide/tags/html/setup.rb +9 -0
- metadata +151 -2
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% even_odd = 'odd' %>
|
2
|
+
<% collect_tags.each do |tag| %>
|
3
|
+
<li class="<%= even_odd %> <%= tag.object.has_tag?(:deprecated) ? 'deprecated' : '' %>">
|
4
|
+
<div class="item">
|
5
|
+
<span class="object_link"><%= tag_link(tag) %></span>
|
6
|
+
</div>
|
7
|
+
</li>
|
8
|
+
<% even_odd = (even_odd == 'even' ? 'odd' : 'even') %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h2>Tag Listing</h2>
|
2
|
+
<p>The following are a brief list of tags that can be used in YARD formatted
|
3
|
+
documentation. See <%= link_file "docs/Tags.md" %> for information on using tags.</p>
|
4
|
+
<ul id="tags" class="index_inline_list">
|
5
|
+
<% n = 1 %>
|
6
|
+
<% collect_tags.each do |tag| %>
|
7
|
+
<li class="r<%= n %>"><%= tag_link(tag) %></li>
|
8
|
+
<% n = n == 2 ? 1 : 2 %>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
<div class="clear"></div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% [["Tag", all_tags], ["Directive", all_directives]].each do |(name, list)| %>
|
2
|
+
<h2><%= name %> List</h2>
|
3
|
+
|
4
|
+
<% list.each_with_index do |tag, i| %>
|
5
|
+
<div class="method_details <%= i == 0 ? 'first' : '' %>">
|
6
|
+
<h3 class="signature"
|
7
|
+
id="<%= tag.name %>" toc-title="<%= tag_link_name(tag) %>">
|
8
|
+
<%= tag_signature tag %>
|
9
|
+
</h3>
|
10
|
+
<% if name == "Directive" %>
|
11
|
+
<%= yieldall :object => P("YARD::Tags::#{tag.text}") %>
|
12
|
+
<% else %>
|
13
|
+
<%= yieldall :object => tag.object %>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<% end%>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
def init
|
3
|
+
sections :list, [T('docstring')]
|
4
|
+
end
|
5
|
+
|
6
|
+
def tag_signature(tag)
|
7
|
+
types = tag.types || []
|
8
|
+
signature = "<strong>#{tag_link_name(tag)}</strong> "
|
9
|
+
sig_tag = tag.object.tag('yard.signature')
|
10
|
+
extra = sig_tag.text if sig_tag
|
11
|
+
extra ||= case types.first
|
12
|
+
when 'with_name'
|
13
|
+
"name description"
|
14
|
+
when 'with_types'
|
15
|
+
"[Types] description"
|
16
|
+
when 'with_types_and_name'
|
17
|
+
"name [Types] description"
|
18
|
+
when 'with_title_and_text'
|
19
|
+
"title\ndescription"
|
20
|
+
when 'with_types_and_title'
|
21
|
+
"[Types] title\ndescription"
|
22
|
+
else
|
23
|
+
"description"
|
24
|
+
end
|
25
|
+
signature + h(extra).gsub(/\n/, "<br/> ")
|
26
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
include YARD
|
3
|
+
include Templates
|
4
|
+
|
5
|
+
module TagTemplateHelper
|
6
|
+
def all_tags
|
7
|
+
Registry.all(:method).map {|m| m.tag('yard.tag') }.compact
|
8
|
+
end
|
9
|
+
|
10
|
+
def all_directives
|
11
|
+
Registry.all(:method).map {|m| m.tag('yard.directive') }.compact
|
12
|
+
end
|
13
|
+
|
14
|
+
def collect_tags
|
15
|
+
(all_tags + all_directives).sort_by(&:name)
|
16
|
+
end
|
17
|
+
|
18
|
+
def tag_link(tag)
|
19
|
+
link_file("docs/Tags.md", tag_link_name(tag), tag.name)
|
20
|
+
end
|
21
|
+
|
22
|
+
def tag_link_name(tag)
|
23
|
+
prefix = tag.tag_name == 'yard.directive' ? '@!' : '@'
|
24
|
+
h(prefix + tag.name)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Wrap url_for and url_for_file to rewrite object when generating docs for
|
28
|
+
# yard.tag/directive objects.
|
29
|
+
%w(url_for url_for_file).each do |meth|
|
30
|
+
self.class.send(:define_method, meth) do
|
31
|
+
if object.is_a?(CodeObjects::Base) &&
|
32
|
+
(object.tag('yard.tag') || object.tag('yard.directive') ||
|
33
|
+
(object.type == :class && object.superclass.name == :Directive))
|
34
|
+
obj = object
|
35
|
+
self.object = Registry.root
|
36
|
+
url = super
|
37
|
+
self.object = obj
|
38
|
+
url
|
39
|
+
else
|
40
|
+
super
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def linkify(*args)
|
46
|
+
if args.first.is_a?(String)
|
47
|
+
case args.first
|
48
|
+
when "yard:include_tags"
|
49
|
+
return T('yard_tags').run(options)
|
50
|
+
when /^tag:(\S+)/
|
51
|
+
tag_name = $1
|
52
|
+
suffix = "tag"
|
53
|
+
if tag_name =~ /^!/
|
54
|
+
tag_name = tag_name[1..-1]
|
55
|
+
suffix = "directive"
|
56
|
+
end
|
57
|
+
|
58
|
+
obj = Registry.at("YARD::Tags::Library##{tag_name}_#{suffix}")
|
59
|
+
return tag_link(obj.tag("yard.#{suffix}")) if obj
|
60
|
+
|
61
|
+
log.warn "Cannot find tag: #{args.first}"
|
62
|
+
return args.first
|
63
|
+
end
|
64
|
+
end
|
65
|
+
super
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
Template.extra_includes << TagTemplateHelper
|
70
|
+
Engine.register_template_path(File.dirname(__FILE__))
|
data/lib/yard/version.rb
CHANGED