yard 0.9.39 → 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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -1
  3. data/README.md +18 -21
  4. data/docs/GettingStarted.md +41 -15
  5. data/docs/Tags.md +5 -5
  6. data/docs/WhatsNew.md +59 -7
  7. data/docs/templates/default/yard_tags/html/setup.rb +1 -1
  8. data/lib/yard/autoload.rb +17 -0
  9. data/lib/yard/cli/diff.rb +7 -2
  10. data/lib/yard/code_objects/proxy.rb +1 -1
  11. data/lib/yard/handlers/processor.rb +1 -0
  12. data/lib/yard/handlers/rbs/attribute_handler.rb +43 -0
  13. data/lib/yard/handlers/rbs/base.rb +38 -0
  14. data/lib/yard/handlers/rbs/constant_handler.rb +18 -0
  15. data/lib/yard/handlers/rbs/method_handler.rb +327 -0
  16. data/lib/yard/handlers/rbs/mixin_handler.rb +20 -0
  17. data/lib/yard/handlers/rbs/namespace_handler.rb +26 -0
  18. data/lib/yard/handlers/ruby/attribute_handler.rb +7 -4
  19. data/lib/yard/handlers/ruby/constant_handler.rb +1 -0
  20. data/lib/yard/i18n/locale.rb +1 -1
  21. data/lib/yard/i18n/pot_generator.rb +1 -1
  22. data/lib/yard/parser/rbs/rbs_parser.rb +325 -0
  23. data/lib/yard/parser/rbs/statement.rb +75 -0
  24. data/lib/yard/parser/ruby/ruby_parser.rb +51 -1
  25. data/lib/yard/parser/source_parser.rb +3 -2
  26. data/lib/yard/registry_resolver.rb +7 -0
  27. data/lib/yard/server/library_version.rb +1 -1
  28. data/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +208 -12
  29. data/lib/yard/server/templates/default/layout/html/breadcrumb.erb +1 -17
  30. data/lib/yard/server/templates/default/method_details/html/permalink.erb +4 -2
  31. data/lib/yard/server/templates/doc_server/library_list/html/headers.erb +3 -3
  32. data/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +2 -3
  33. data/lib/yard/server/templates/doc_server/processing/html/processing.erb +22 -16
  34. data/lib/yard/tags/directives.rb +7 -0
  35. data/lib/yard/tags/library.rb +3 -3
  36. data/lib/yard/tags/types_explainer.rb +2 -1
  37. data/lib/yard/templates/helpers/base_helper.rb +1 -1
  38. data/lib/yard/templates/helpers/html_helper.rb +15 -4
  39. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +6 -1
  40. data/lib/yard/templates/helpers/markup/hybrid_markdown.rb +2125 -0
  41. data/lib/yard/templates/helpers/markup_helper.rb +4 -2
  42. data/lib/yard/version.rb +1 -1
  43. data/po/ja.po +82 -82
  44. data/templates/default/fulldoc/html/full_list.erb +4 -4
  45. data/templates/default/fulldoc/html/js/app.js +503 -319
  46. data/templates/default/fulldoc/html/js/full_list.js +310 -213
  47. data/templates/default/layout/html/headers.erb +1 -1
  48. data/templates/default/method/html/header.erb +3 -3
  49. data/templates/default/module/html/defines.erb +3 -3
  50. data/templates/default/module/html/inherited_methods.erb +1 -0
  51. data/templates/default/module/html/method_summary.erb +8 -0
  52. data/templates/default/module/setup.rb +20 -0
  53. data/templates/default/onefile/html/layout.erb +3 -4
  54. data/templates/guide/fulldoc/html/js/app.js +57 -26
  55. data/templates/guide/layout/html/layout.erb +9 -11
  56. metadata +13 -4
@@ -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.39
4
+ version: 0.9.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-08 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
@@ -171,6 +177,8 @@ files:
171
177
  - lib/yard/parser/c/c_parser.rb
172
178
  - lib/yard/parser/c/comment_parser.rb
173
179
  - lib/yard/parser/c/statement.rb
180
+ - lib/yard/parser/rbs/rbs_parser.rb
181
+ - lib/yard/parser/rbs/statement.rb
174
182
  - lib/yard/parser/ruby/ast_node.rb
175
183
  - lib/yard/parser/ruby/legacy/irb/slex.rb
176
184
  - lib/yard/parser/ruby/legacy/ruby_lex.rb
@@ -253,6 +261,7 @@ files:
253
261
  - lib/yard/templates/helpers/filter_helper.rb
254
262
  - lib/yard/templates/helpers/html_helper.rb
255
263
  - lib/yard/templates/helpers/html_syntax_highlight_helper.rb
264
+ - lib/yard/templates/helpers/markup/hybrid_markdown.rb
256
265
  - lib/yard/templates/helpers/markup/rdoc_markdown.rb
257
266
  - lib/yard/templates/helpers/markup/rdoc_markup.rb
258
267
  - lib/yard/templates/helpers/markup_helper.rb
@@ -393,7 +402,7 @@ files:
393
402
  - templates/guide/onefile/html/setup.rb
394
403
  - templates/guide/onefile/html/toc.erb
395
404
  - templates/guide/tags/html/setup.rb
396
- homepage: http://yardoc.org
405
+ homepage: https://yardoc.org
397
406
  licenses:
398
407
  - MIT
399
408
  metadata:
@@ -407,7 +416,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
407
416
  requirements:
408
417
  - - ">="
409
418
  - !ruby/object:Gem::Version
410
- version: '0'
419
+ version: 1.8.7
411
420
  required_rubygems_version: !ruby/object:Gem::Requirement
412
421
  requirements:
413
422
  - - ">="