yard 0.9.36 → 0.9.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +59 -1
  3. data/README.md +29 -25
  4. data/docs/GettingStarted.md +41 -15
  5. data/docs/Tags.md +5 -5
  6. data/docs/Templates.md +5 -4
  7. data/docs/WhatsNew.md +59 -7
  8. data/docs/templates/default/yard_tags/html/setup.rb +1 -1
  9. data/lib/yard/autoload.rb +18 -0
  10. data/lib/yard/cli/diff.rb +7 -2
  11. data/lib/yard/code_objects/base.rb +1 -1
  12. data/lib/yard/code_objects/extra_file_object.rb +1 -0
  13. data/lib/yard/code_objects/macro_object.rb +0 -1
  14. data/lib/yard/code_objects/proxy.rb +1 -1
  15. data/lib/yard/docstring_parser.rb +0 -1
  16. data/lib/yard/handlers/base.rb +23 -1
  17. data/lib/yard/handlers/processor.rb +1 -1
  18. data/lib/yard/handlers/rbs/attribute_handler.rb +43 -0
  19. data/lib/yard/handlers/rbs/base.rb +38 -0
  20. data/lib/yard/handlers/rbs/constant_handler.rb +18 -0
  21. data/lib/yard/handlers/rbs/method_handler.rb +327 -0
  22. data/lib/yard/handlers/rbs/mixin_handler.rb +20 -0
  23. data/lib/yard/handlers/rbs/namespace_handler.rb +26 -0
  24. data/lib/yard/handlers/ruby/attribute_handler.rb +7 -4
  25. data/lib/yard/handlers/ruby/constant_handler.rb +24 -6
  26. data/lib/yard/handlers/ruby/legacy/visibility_handler.rb +2 -1
  27. data/lib/yard/handlers/ruby/visibility_handler.rb +14 -1
  28. data/lib/yard/i18n/locale.rb +1 -1
  29. data/lib/yard/i18n/pot_generator.rb +1 -1
  30. data/lib/yard/logging.rb +116 -61
  31. data/lib/yard/open_struct.rb +67 -0
  32. data/lib/yard/parser/rbs/rbs_parser.rb +325 -0
  33. data/lib/yard/parser/rbs/statement.rb +75 -0
  34. data/lib/yard/parser/ruby/ast_node.rb +5 -4
  35. data/lib/yard/parser/ruby/legacy/irb/slex.rb +19 -1
  36. data/lib/yard/parser/ruby/legacy/ruby_lex.rb +20 -5
  37. data/lib/yard/parser/ruby/ruby_parser.rb +109 -24
  38. data/lib/yard/parser/source_parser.rb +5 -4
  39. data/lib/yard/registry_resolver.rb +7 -0
  40. data/lib/yard/rubygems/specification.rb +1 -1
  41. data/lib/yard/server/library_version.rb +1 -1
  42. data/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +208 -12
  43. data/lib/yard/server/templates/default/layout/html/breadcrumb.erb +1 -17
  44. data/lib/yard/server/templates/default/method_details/html/permalink.erb +4 -2
  45. data/lib/yard/server/templates/doc_server/library_list/html/headers.erb +3 -3
  46. data/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +2 -3
  47. data/lib/yard/server/templates/doc_server/processing/html/processing.erb +22 -16
  48. data/lib/yard/tags/default_factory.rb +1 -0
  49. data/lib/yard/tags/directives.rb +7 -1
  50. data/lib/yard/tags/library.rb +3 -3
  51. data/lib/yard/tags/overload_tag.rb +2 -1
  52. data/lib/yard/tags/tag.rb +2 -1
  53. data/lib/yard/tags/types_explainer.rb +5 -4
  54. data/lib/yard/templates/engine.rb +0 -1
  55. data/lib/yard/templates/helpers/base_helper.rb +1 -1
  56. data/lib/yard/templates/helpers/html_helper.rb +21 -6
  57. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +6 -1
  58. data/lib/yard/templates/helpers/markup/hybrid_markdown.rb +2125 -0
  59. data/lib/yard/templates/helpers/markup/rdoc_markup.rb +2 -0
  60. data/lib/yard/templates/helpers/markup_helper.rb +4 -2
  61. data/lib/yard/templates/template_options.rb +0 -1
  62. data/lib/yard/version.rb +1 -1
  63. data/po/ja.po +82 -82
  64. data/templates/default/fulldoc/html/css/full_list.css +3 -3
  65. data/templates/default/fulldoc/html/css/style.css +8 -15
  66. data/templates/default/fulldoc/html/full_list.erb +8 -5
  67. data/templates/default/fulldoc/html/js/app.js +546 -281
  68. data/templates/default/fulldoc/html/js/full_list.js +315 -189
  69. data/templates/default/fulldoc/html/setup.rb +10 -2
  70. data/templates/default/layout/html/headers.erb +1 -1
  71. data/templates/default/method/html/header.erb +3 -3
  72. data/templates/default/module/html/defines.erb +3 -3
  73. data/templates/default/module/html/inherited_methods.erb +1 -0
  74. data/templates/default/module/html/method_summary.erb +8 -0
  75. data/templates/default/module/setup.rb +20 -0
  76. data/templates/default/onefile/html/headers.erb +2 -0
  77. data/templates/default/onefile/html/layout.erb +3 -4
  78. data/templates/default/tags/html/example.erb +2 -2
  79. data/templates/guide/fulldoc/html/js/app.js +57 -26
  80. data/templates/guide/layout/html/layout.erb +9 -11
  81. metadata +19 -8
@@ -1,9 +1,9 @@
1
1
  <% if object.has_tag?(:example) %>
2
2
  <div class="examples">
3
- <p class="tag_title">Examples:</p>
3
+ <h4 class="tag_title">Examples:</h4>
4
4
  <% object.tags(:example).each do |tag| %>
5
5
  <% unless tag.name.empty? %>
6
- <p class="example_title"><%= htmlify_line(tag.name) %></p>
6
+ <h5 class="example_title"><%= htmlify_line(tag.name) %></h5>
7
7
  <% end %>
8
8
  <pre class="example code"><code><%= html_syntax_highlight(tag.text) %></code></pre>
9
9
  <% end %>
@@ -1,33 +1,64 @@
1
1
  function generateTOC() {
2
- if ($('#filecontents').length == 0) return;
3
- var _toc = $('<ol class="top"></ol>');
4
- var show = false;
5
- var toc = _toc;
2
+ var fileContents = document.getElementById("filecontents");
3
+ var tocRoot = document.getElementById("toc");
4
+ var topLevel = document.createElement("ol");
5
+ var currentList = topLevel;
6
+ var lastLevel = 1;
7
+ var currentItem = null;
6
8
  var counter = 0;
7
- var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
8
- for (i in tags) { tags[i] = '#filecontents > ' + tags[i] }
9
- var lastTag = parseInt(tags[0][1]);
10
- $(tags.join(', ')).each(function() {
11
- if (this.id == "filecontents") return;
12
- show = true;
13
- var thisTag = parseInt(this.tagName[1]);
14
- if (this.id.length == 0) {
15
- var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
16
- if ($('#' + proposedId).length > 0) proposedId += counter++;
17
- this.id = proposedId;
9
+ var headings;
10
+ var hasEntries = false;
11
+
12
+ if (!fileContents || !tocRoot) return;
13
+
14
+ topLevel.className = "top";
15
+ headings = fileContents.querySelectorAll(
16
+ ":scope > h1, :scope > h2, :scope > h3, :scope > h4, :scope > h5, :scope > h6"
17
+ );
18
+
19
+ Array.prototype.forEach.call(headings, function(heading) {
20
+ var level;
21
+ var item;
22
+ var link;
23
+
24
+ if (heading.id === "filecontents") return;
25
+ hasEntries = true;
26
+ level = parseInt(heading.tagName.substring(1), 10);
27
+
28
+ if (!heading.id) {
29
+ var proposedId = heading.textContent.replace(/[^a-z0-9-]/gi, "_");
30
+ if (document.getElementById(proposedId)) proposedId += counter++;
31
+ heading.id = proposedId;
18
32
  }
19
- if (thisTag > lastTag) {
20
- for (var i = 0; i < thisTag - lastTag; i++) {
21
- var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
33
+
34
+ if (level > lastLevel) {
35
+ while (level > lastLevel) {
36
+ if (!currentItem) {
37
+ currentItem = document.createElement("li");
38
+ currentList.appendChild(currentItem);
39
+ }
40
+ var nestedList = document.createElement("ol");
41
+ currentItem.appendChild(nestedList);
42
+ currentList = nestedList;
43
+ currentItem = null;
44
+ lastLevel += 1;
45
+ }
46
+ } else if (level < lastLevel) {
47
+ while (level < lastLevel && currentList.parentElement) {
48
+ currentList = currentList.parentElement.parentElement;
49
+ lastLevel -= 1;
22
50
  }
23
51
  }
24
- if (thisTag < lastTag) {
25
- for (var i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
26
- }
27
- toc.append('<li><a href="#' + this.id + '">' + $(this).text() + '</a></li>');
28
- lastTag = thisTag;
52
+
53
+ item = document.createElement("li");
54
+ link = document.createElement("a");
55
+ link.href = "#" + heading.id;
56
+ link.textContent = heading.textContent;
57
+ item.appendChild(link);
58
+ currentList.appendChild(item);
59
+ currentItem = item;
29
60
  });
30
- if (!show) return;
31
- $('#toc').append()
32
- $('#toc').append(_toc);
61
+
62
+ if (!hasEntries) return;
63
+ tocRoot.appendChild(topLevel);
33
64
  }
@@ -1,20 +1,18 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+ <html lang="en">
4
3
  <head>
5
4
  <%= erb(:headers) %>
6
5
  <script type="text/javascript">
7
- $(function() {
8
- $('.object_link').each(function() {
9
- $(this).html($(this).find('a').html())
6
+ document.addEventListener("DOMContentLoaded", function() {
7
+ Array.prototype.forEach.call(document.querySelectorAll('.object_link'), function(node) {
8
+ var link = node.querySelector('a');
9
+ if (link) node.innerHTML = link.innerHTML;
10
10
  });
11
- });
12
- $(function() {
13
11
  generateTOC();
14
- if ($('#toc li').size() == 0) {
15
- $('#sidebar h2.toc').hide();
12
+ if (document.querySelectorAll('#toc li').length === 0) {
13
+ document.querySelector('#sidebar h2.toc').style.display = 'none';
16
14
  }
17
- })
15
+ });
18
16
  </script>
19
17
  </head>
20
18
  <body>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.36
4
+ version: 0.9.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-29 00:00:00.000000000 Z
11
+ date: 2026-04-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  YARD is a documentation generation tool for the Ruby programming language.
@@ -115,6 +115,12 @@ files:
115
115
  - lib/yard/handlers/c/symbol_handler.rb
116
116
  - lib/yard/handlers/common/method_handler.rb
117
117
  - lib/yard/handlers/processor.rb
118
+ - lib/yard/handlers/rbs/attribute_handler.rb
119
+ - lib/yard/handlers/rbs/base.rb
120
+ - lib/yard/handlers/rbs/constant_handler.rb
121
+ - lib/yard/handlers/rbs/method_handler.rb
122
+ - lib/yard/handlers/rbs/mixin_handler.rb
123
+ - lib/yard/handlers/rbs/namespace_handler.rb
118
124
  - lib/yard/handlers/ruby/alias_handler.rb
119
125
  - lib/yard/handlers/ruby/attribute_handler.rb
120
126
  - lib/yard/handlers/ruby/base.rb
@@ -165,11 +171,14 @@ files:
165
171
  - lib/yard/i18n/pot_generator.rb
166
172
  - lib/yard/i18n/text.rb
167
173
  - lib/yard/logging.rb
174
+ - lib/yard/open_struct.rb
168
175
  - lib/yard/options.rb
169
176
  - lib/yard/parser/base.rb
170
177
  - lib/yard/parser/c/c_parser.rb
171
178
  - lib/yard/parser/c/comment_parser.rb
172
179
  - lib/yard/parser/c/statement.rb
180
+ - lib/yard/parser/rbs/rbs_parser.rb
181
+ - lib/yard/parser/rbs/statement.rb
173
182
  - lib/yard/parser/ruby/ast_node.rb
174
183
  - lib/yard/parser/ruby/legacy/irb/slex.rb
175
184
  - lib/yard/parser/ruby/legacy/ruby_lex.rb
@@ -252,6 +261,7 @@ files:
252
261
  - lib/yard/templates/helpers/filter_helper.rb
253
262
  - lib/yard/templates/helpers/html_helper.rb
254
263
  - lib/yard/templates/helpers/html_syntax_highlight_helper.rb
264
+ - lib/yard/templates/helpers/markup/hybrid_markdown.rb
255
265
  - lib/yard/templates/helpers/markup/rdoc_markdown.rb
256
266
  - lib/yard/templates/helpers/markup/rdoc_markup.rb
257
267
  - lib/yard/templates/helpers/markup_helper.rb
@@ -392,12 +402,13 @@ files:
392
402
  - templates/guide/onefile/html/setup.rb
393
403
  - templates/guide/onefile/html/toc.erb
394
404
  - templates/guide/tags/html/setup.rb
395
- homepage: http://yardoc.org
405
+ homepage: https://yardoc.org
396
406
  licenses:
397
407
  - MIT
398
408
  metadata:
399
409
  yard.run: yri
400
- post_install_message:
410
+ changelog_uri: https://rubydoc.info/gems/yard/file/CHANGELOG.md
411
+ post_install_message:
401
412
  rdoc_options: []
402
413
  require_paths:
403
414
  - lib
@@ -405,15 +416,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
405
416
  requirements:
406
417
  - - ">="
407
418
  - !ruby/object:Gem::Version
408
- version: '0'
419
+ version: 1.8.7
409
420
  required_rubygems_version: !ruby/object:Gem::Requirement
410
421
  requirements:
411
422
  - - ">="
412
423
  - !ruby/object:Gem::Version
413
424
  version: '0'
414
425
  requirements: []
415
- rubygems_version: 3.3.5
416
- signing_key:
426
+ rubygems_version: 3.4.20
427
+ signing_key:
417
428
  specification_version: 4
418
429
  summary: Documentation tool for consistent and usable documentation in Ruby.
419
430
  test_files: []