rdoc 7.0.3 → 7.2.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.
- checksums.yaml +4 -4
- data/README.md +70 -4
- data/doc/markup_reference/markdown.md +558 -0
- data/doc/markup_reference/rdoc.rdoc +1169 -0
- data/lib/rdoc/code_object/attr.rb +2 -1
- data/lib/rdoc/code_object/class_module.rb +24 -3
- data/lib/rdoc/code_object/context/section.rb +46 -9
- data/lib/rdoc/code_object/context.rb +15 -4
- data/lib/rdoc/code_object/mixin.rb +3 -0
- data/lib/rdoc/code_object/top_level.rb +2 -0
- data/lib/rdoc/comment.rb +1 -1
- data/lib/rdoc/cross_reference.rb +31 -24
- data/lib/rdoc/generator/template/aliki/_head.rhtml +5 -0
- data/lib/rdoc/generator/template/aliki/class.rhtml +8 -6
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +48 -36
- data/lib/rdoc/generator/template/aliki/js/aliki.js +8 -2
- data/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
- data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +1 -1
- data/lib/rdoc/generator/template/aliki/js/search_controller.js +1 -1
- data/lib/rdoc/generator/template/darkfish/class.rhtml +2 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +19 -0
- data/lib/rdoc/markdown.kpeg +22 -12
- data/lib/rdoc/markdown.rb +36 -26
- data/lib/rdoc/markup/formatter.rb +129 -106
- data/lib/rdoc/markup/heading.rb +101 -29
- data/lib/rdoc/markup/inline_parser.rb +312 -0
- data/lib/rdoc/markup/parser.rb +1 -1
- data/lib/rdoc/markup/to_ansi.rb +51 -4
- data/lib/rdoc/markup/to_bs.rb +22 -42
- data/lib/rdoc/markup/to_html.rb +178 -183
- data/lib/rdoc/markup/to_html_crossref.rb +58 -79
- data/lib/rdoc/markup/to_html_snippet.rb +62 -62
- data/lib/rdoc/markup/to_label.rb +29 -20
- data/lib/rdoc/markup/to_markdown.rb +61 -37
- data/lib/rdoc/markup/to_rdoc.rb +86 -26
- data/lib/rdoc/markup/to_test.rb +9 -1
- data/lib/rdoc/markup/to_tt_only.rb +10 -16
- data/lib/rdoc/markup/verbatim.rb +1 -1
- data/lib/rdoc/markup.rb +10 -32
- data/lib/rdoc/parser/changelog.rb +29 -0
- data/lib/rdoc/parser/prism_ruby.rb +44 -32
- data/lib/rdoc/parser/ruby.rb +1 -1
- data/lib/rdoc/text.rb +44 -5
- data/lib/rdoc/token_stream.rb +4 -8
- data/lib/rdoc/version.rb +1 -1
- data/rdoc.gemspec +2 -2
- metadata +7 -12
- data/ExampleMarkdown.md +0 -39
- data/ExampleRDoc.rdoc +0 -210
- data/lib/rdoc/markup/attr_changer.rb +0 -22
- data/lib/rdoc/markup/attr_span.rb +0 -35
- data/lib/rdoc/markup/attribute_manager.rb +0 -405
- data/lib/rdoc/markup/attributes.rb +0 -70
- data/lib/rdoc/markup/regexp_handling.rb +0 -40
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
##
|
|
3
|
-
# We manage a set of attributes. Each attribute has a symbol name and a bit
|
|
4
|
-
# value.
|
|
5
|
-
|
|
6
|
-
class RDoc::Markup::Attributes
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
# The regexp handling attribute type. See RDoc::Markup#add_regexp_handling
|
|
10
|
-
|
|
11
|
-
attr_reader :regexp_handling
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
# Creates a new attributes set.
|
|
15
|
-
|
|
16
|
-
def initialize
|
|
17
|
-
@regexp_handling = 1
|
|
18
|
-
|
|
19
|
-
@name_to_bitmap = [
|
|
20
|
-
[:_REGEXP_HANDLING_, @regexp_handling],
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
@next_bitmap = @regexp_handling << 1
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
##
|
|
27
|
-
# Returns a unique bit for +name+
|
|
28
|
-
|
|
29
|
-
def bitmap_for(name)
|
|
30
|
-
bitmap = @name_to_bitmap.assoc name
|
|
31
|
-
|
|
32
|
-
unless bitmap then
|
|
33
|
-
bitmap = @next_bitmap
|
|
34
|
-
@next_bitmap <<= 1
|
|
35
|
-
@name_to_bitmap << [name, bitmap]
|
|
36
|
-
else
|
|
37
|
-
bitmap = bitmap.last
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
bitmap
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
##
|
|
44
|
-
# Returns a string representation of +bitmap+
|
|
45
|
-
|
|
46
|
-
def as_string(bitmap)
|
|
47
|
-
return 'none' if bitmap.zero?
|
|
48
|
-
res = []
|
|
49
|
-
|
|
50
|
-
@name_to_bitmap.each do |name, bit|
|
|
51
|
-
res << name if (bitmap & bit) != 0
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
res.join ','
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
##
|
|
58
|
-
# yields each attribute name in +bitmap+
|
|
59
|
-
|
|
60
|
-
def each_name_of(bitmap)
|
|
61
|
-
return enum_for __method__, bitmap unless block_given?
|
|
62
|
-
|
|
63
|
-
@name_to_bitmap.each do |name, bit|
|
|
64
|
-
next if bit == @regexp_handling
|
|
65
|
-
|
|
66
|
-
yield name.to_s if (bitmap & bit) != 0
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
##
|
|
3
|
-
# Hold details of a regexp handling sequence
|
|
4
|
-
|
|
5
|
-
class RDoc::Markup::RegexpHandling
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
# Regexp handling type
|
|
9
|
-
|
|
10
|
-
attr_reader :type
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
# Regexp handling text
|
|
14
|
-
|
|
15
|
-
attr_accessor :text
|
|
16
|
-
|
|
17
|
-
##
|
|
18
|
-
# Creates a new regexp handling sequence of +type+ with +text+
|
|
19
|
-
|
|
20
|
-
def initialize(type, text)
|
|
21
|
-
@type, @text = type, text
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
##
|
|
25
|
-
# Regexp handlings are equal when the have the same text and type
|
|
26
|
-
|
|
27
|
-
def ==(o)
|
|
28
|
-
self.text == o.text && self.type == o.type
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def inspect # :nodoc:
|
|
32
|
-
"#<RDoc::Markup::RegexpHandling:0x%x @type=%p, @text=%p>" % [
|
|
33
|
-
object_id, @type, text.dump]
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def to_s # :nodoc:
|
|
37
|
-
"RegexpHandling: type=#{type} text=#{text.dump}"
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
end
|