rdoc 8.0.0 → 8.1.0

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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -3
  3. data/RI.md +75 -75
  4. data/exe/rdoc +2 -2
  5. data/lib/rdoc/code_object/alias.rb +71 -69
  6. data/lib/rdoc/code_object/any_method.rb +305 -303
  7. data/lib/rdoc/code_object/attr.rb +150 -148
  8. data/lib/rdoc/code_object/class_module.rb +798 -792
  9. data/lib/rdoc/code_object/constant.rb +175 -173
  10. data/lib/rdoc/code_object/context/section.rb +142 -138
  11. data/lib/rdoc/code_object/context.rb +926 -958
  12. data/lib/rdoc/code_object/extend.rb +7 -5
  13. data/lib/rdoc/code_object/include.rb +7 -5
  14. data/lib/rdoc/code_object/method_attr.rb +326 -319
  15. data/lib/rdoc/code_object/mixin.rb +97 -95
  16. data/lib/rdoc/code_object/normal_class.rb +77 -78
  17. data/lib/rdoc/code_object/normal_module.rb +61 -59
  18. data/lib/rdoc/code_object/require.rb +23 -39
  19. data/lib/rdoc/code_object/single_class.rb +21 -19
  20. data/lib/rdoc/code_object/top_level.rb +212 -219
  21. data/lib/rdoc/code_object.rb +305 -303
  22. data/lib/rdoc/comment.rb +275 -273
  23. data/lib/rdoc/cross_reference.rb +192 -190
  24. data/lib/rdoc/encoding.rb +105 -103
  25. data/lib/rdoc/erb_partial.rb +13 -11
  26. data/lib/rdoc/erbio.rb +29 -27
  27. data/lib/rdoc/generator/aliki.rb +161 -153
  28. data/lib/rdoc/generator/darkfish.rb +645 -635
  29. data/lib/rdoc/generator/json_index.rb +233 -229
  30. data/lib/rdoc/generator/markup.rb +164 -146
  31. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  32. data/lib/rdoc/generator/pot/po.rb +52 -51
  33. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  34. data/lib/rdoc/generator/pot.rb +85 -81
  35. data/lib/rdoc/generator/ri.rb +23 -19
  36. data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
  37. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  38. data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
  39. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  40. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  41. data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
  42. data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
  43. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  44. data/lib/rdoc/generator.rb +48 -46
  45. data/lib/rdoc/i18n/locale.rb +99 -95
  46. data/lib/rdoc/i18n/text.rb +109 -105
  47. data/lib/rdoc/i18n.rb +7 -5
  48. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  49. data/lib/rdoc/markdown.kpeg +15 -11
  50. data/lib/rdoc/markdown.rb +40 -47
  51. data/lib/rdoc/markup/block_quote.rb +12 -8
  52. data/lib/rdoc/markup/document.rb +127 -123
  53. data/lib/rdoc/markup/formatter.rb +219 -215
  54. data/lib/rdoc/markup/include.rb +33 -29
  55. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  56. data/lib/rdoc/markup/inline_parser.rb +281 -277
  57. data/lib/rdoc/markup/list.rb +80 -88
  58. data/lib/rdoc/markup/list_item.rb +73 -85
  59. data/lib/rdoc/markup/paragraph.rb +23 -19
  60. data/lib/rdoc/markup/parser.rb +501 -497
  61. data/lib/rdoc/markup/pre_process.rb +283 -279
  62. data/lib/rdoc/markup/raw.rb +2 -2
  63. data/lib/rdoc/markup/rule.rb +16 -12
  64. data/lib/rdoc/markup/to_ansi.rb +143 -139
  65. data/lib/rdoc/markup/to_bs.rb +72 -68
  66. data/lib/rdoc/markup/to_html.rb +594 -565
  67. data/lib/rdoc/markup/to_html_crossref.rb +234 -230
  68. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  69. data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
  70. data/lib/rdoc/markup/to_label.rb +63 -59
  71. data/lib/rdoc/markup/to_markdown.rb +212 -208
  72. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  73. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  74. data/lib/rdoc/markup/to_test.rb +60 -56
  75. data/lib/rdoc/markup/to_tt_only.rb +84 -80
  76. data/lib/rdoc/markup/verbatim.rb +62 -58
  77. data/lib/rdoc/markup.rb +198 -196
  78. data/lib/rdoc/options.rb +1063 -1061
  79. data/lib/rdoc/parser/c.rb +1039 -1037
  80. data/lib/rdoc/parser/changelog.rb +319 -315
  81. data/lib/rdoc/parser/markdown.rb +17 -13
  82. data/lib/rdoc/parser/rbs.rb +239 -235
  83. data/lib/rdoc/parser/rd.rb +17 -13
  84. data/lib/rdoc/parser/ruby.rb +1245 -1124
  85. data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
  86. data/lib/rdoc/parser/simple.rb +31 -27
  87. data/lib/rdoc/parser/text.rb +12 -8
  88. data/lib/rdoc/parser.rb +228 -220
  89. data/lib/rdoc/rbs_helper.rb +1 -1
  90. data/lib/rdoc/rd/inline.rb +57 -53
  91. data/lib/rdoc/rd.rb +90 -88
  92. data/lib/rdoc/rdoc.rb +500 -491
  93. data/lib/rdoc/ri/driver.rb +1140 -1135
  94. data/lib/rdoc/ri/formatter.rb +7 -3
  95. data/lib/rdoc/ri/paths.rb +140 -136
  96. data/lib/rdoc/ri/servlet.rb +354 -350
  97. data/lib/rdoc/ri/store.rb +4 -2
  98. data/lib/rdoc/ri/task.rb +55 -51
  99. data/lib/rdoc/ri.rb +14 -12
  100. data/lib/rdoc/rubygems_hook.rb +183 -181
  101. data/lib/rdoc/server.rb +349 -347
  102. data/lib/rdoc/stats/normal.rb +46 -42
  103. data/lib/rdoc/stats/quiet.rb +39 -35
  104. data/lib/rdoc/stats/verbose.rb +35 -31
  105. data/lib/rdoc/stats.rb +365 -363
  106. data/lib/rdoc/store.rb +888 -902
  107. data/lib/rdoc/task.rb +260 -256
  108. data/lib/rdoc/text.rb +135 -133
  109. data/lib/rdoc/token_stream.rb +101 -93
  110. data/lib/rdoc/tom_doc.rb +203 -201
  111. data/lib/rdoc/version.rb +1 -1
  112. metadata +4 -5
  113. data/lib/rdoc/markdown/literals.kpeg +0 -21
  114. data/lib/rdoc/markdown/literals.rb +0 -454
data/lib/rdoc/rd.rb CHANGED
@@ -1,99 +1,101 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # RDoc::RD implements the RD format from the rdtool gem.
4
- #
5
- # To choose RD as your only default format see
6
- # RDoc::Options@Saved+Options for instructions on setting up a
7
- # <code>.doc_options</code> file to store your project default.
8
- #
9
- # == LICENSE
10
- #
11
- # The grammar that produces RDoc::RD::BlockParser and RDoc::RD::InlineParser
12
- # is included in RDoc under the Ruby License.
13
- #
14
- # You can find the original source for rdtool at
15
- # https://github.com/uwabami/rdtool/
16
- #
17
- # You can use, re-distribute or change these files under Ruby's License or GPL.
18
- #
19
- # 1. You may make and give away verbatim copies of the source form of the
20
- # software without restriction, provided that you duplicate all of the
21
- # original copyright notices and associated disclaimers.
22
- #
23
- # 2. You may modify your copy of the software in any way, provided that
24
- # you do at least ONE of the following:
25
- #
26
- # a. place your modifications in the Public Domain or otherwise
27
- # make them Freely Available, such as by posting said
28
- # modifications to Usenet or an equivalent medium, or by allowing
29
- # the author to include your modifications in the software.
30
- #
31
- # b. use the modified software only within your corporation or
32
- # organization.
33
- #
34
- # c. give non-standard binaries non-standard names, with
35
- # instructions on where to get the original software distribution.
36
- #
37
- # d. make other distribution arrangements with the author.
38
- #
39
- # 3. You may distribute the software in object code or binary form,
40
- # provided that you do at least ONE of the following:
41
- #
42
- # a. distribute the binaries and library files of the software,
43
- # together with instructions (in the manual page or equivalent)
44
- # on where to get the original distribution.
45
- #
46
- # b. accompany the distribution with the machine-readable source of
47
- # the software.
48
- #
49
- # c. give non-standard binaries non-standard names, with
50
- # instructions on where to get the original software distribution.
51
- #
52
- # d. make other distribution arrangements with the author.
53
- #
54
- # 4. You may modify and include the part of the software into any other
55
- # software (possibly commercial). But some files in the distribution
56
- # are not written by the author, so that they are not under these terms.
57
- #
58
- # For the list of those files and their copying conditions, see the
59
- # file LEGAL.
60
- #
61
- # 5. The scripts and library files supplied as input to or produced as
62
- # output from the software do not automatically fall under the
63
- # copyright of the software, but belong to whomever generated them,
64
- # and may be sold commercially, and may be aggregated with this
65
- # software.
66
- #
67
- # 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
68
- # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
69
- # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
70
- # PURPOSE.
2
+ module RDoc
3
+ ##
4
+ # RDoc::RD implements the RD format from the rdtool gem.
5
+ #
6
+ # To choose RD as your only default format see
7
+ # RDoc::Options@Saved+Options for instructions on setting up a
8
+ # <code>.doc_options</code> file to store your project default.
9
+ #
10
+ # == LICENSE
11
+ #
12
+ # The grammar that produces RDoc::RD::BlockParser and RDoc::RD::InlineParser
13
+ # is included in RDoc under the Ruby License.
14
+ #
15
+ # You can find the original source for rdtool at
16
+ # https://github.com/uwabami/rdtool/
17
+ #
18
+ # You can use, re-distribute or change these files under Ruby's License or GPL.
19
+ #
20
+ # 1. You may make and give away verbatim copies of the source form of the
21
+ # software without restriction, provided that you duplicate all of the
22
+ # original copyright notices and associated disclaimers.
23
+ #
24
+ # 2. You may modify your copy of the software in any way, provided that
25
+ # you do at least ONE of the following:
26
+ #
27
+ # a. place your modifications in the Public Domain or otherwise
28
+ # make them Freely Available, such as by posting said
29
+ # modifications to Usenet or an equivalent medium, or by allowing
30
+ # the author to include your modifications in the software.
31
+ #
32
+ # b. use the modified software only within your corporation or
33
+ # organization.
34
+ #
35
+ # c. give non-standard binaries non-standard names, with
36
+ # instructions on where to get the original software distribution.
37
+ #
38
+ # d. make other distribution arrangements with the author.
39
+ #
40
+ # 3. You may distribute the software in object code or binary form,
41
+ # provided that you do at least ONE of the following:
42
+ #
43
+ # a. distribute the binaries and library files of the software,
44
+ # together with instructions (in the manual page or equivalent)
45
+ # on where to get the original distribution.
46
+ #
47
+ # b. accompany the distribution with the machine-readable source of
48
+ # the software.
49
+ #
50
+ # c. give non-standard binaries non-standard names, with
51
+ # instructions on where to get the original software distribution.
52
+ #
53
+ # d. make other distribution arrangements with the author.
54
+ #
55
+ # 4. You may modify and include the part of the software into any other
56
+ # software (possibly commercial). But some files in the distribution
57
+ # are not written by the author, so that they are not under these terms.
58
+ #
59
+ # For the list of those files and their copying conditions, see the
60
+ # file LEGAL.
61
+ #
62
+ # 5. The scripts and library files supplied as input to or produced as
63
+ # output from the software do not automatically fall under the
64
+ # copyright of the software, but belong to whomever generated them,
65
+ # and may be sold commercially, and may be aggregated with this
66
+ # software.
67
+ #
68
+ # 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
69
+ # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
70
+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
71
+ # PURPOSE.
71
72
 
72
- class RDoc::RD
73
+ class RD
73
74
 
74
- ##
75
- # Parses +rd+ source and returns an RDoc::Markup::Document. If the
76
- # <tt>=begin</tt> or <tt>=end</tt> lines are missing they will be added.
75
+ ##
76
+ # Parses +rd+ source and returns an RDoc::Markup::Document. If the
77
+ # <tt>=begin</tt> or <tt>=end</tt> lines are missing they will be added.
77
78
 
78
- def self.parse(rd)
79
- rd = rd.lines.to_a
79
+ def self.parse(rd)
80
+ rd = rd.lines.to_a
80
81
 
81
- if rd.find { |i| /\S/ === i } and !rd.find{|i| /^=begin\b/ === i } then
82
- rd.unshift("=begin\n").push("=end\n")
83
- end
82
+ if rd.find { |i| /\S/ === i } and !rd.find{|i| /^=begin\b/ === i }
83
+ rd.unshift("=begin\n").push("=end\n")
84
+ end
84
85
 
85
- parser = RDoc::RD::BlockParser.new
86
- document = parser.parse rd
86
+ parser = RD::BlockParser.new
87
+ document = parser.parse rd
87
88
 
88
- # isn't this always true?
89
- document.parts.shift if RDoc::Markup::BlankLine === document.parts.first
90
- document.parts.pop if RDoc::Markup::BlankLine === document.parts.last
89
+ # isn't this always true?
90
+ document.parts.shift if Markup::BlankLine === document.parts.first
91
+ document.parts.pop if Markup::BlankLine === document.parts.last
91
92
 
92
- document
93
- end
93
+ document
94
+ end
94
95
 
95
- autoload :BlockParser, "#{__dir__}/rd/block_parser"
96
- autoload :InlineParser, "#{__dir__}/rd/inline_parser"
97
- autoload :Inline, "#{__dir__}/rd/inline"
96
+ autoload :BlockParser, "#{__dir__}/rd/block_parser"
97
+ autoload :InlineParser, "#{__dir__}/rd/inline_parser"
98
+ autoload :Inline, "#{__dir__}/rd/inline"
98
99
 
100
+ end
99
101
  end