yard 0.9.40 → 0.9.42
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/CHANGELOG.md +17 -0
- data/docs/Parser.md +17 -42
- data/lib/yard/server/commands/base.rb +1 -1
- data/lib/yard/server/templates/default/fulldoc/html/css/custom.css +168 -88
- data/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +202 -207
- data/lib/yard/templates/helpers/markup/hybrid_markdown.rb +22 -0
- data/lib/yard/version.rb +1 -1
- data/templates/default/fulldoc/html/css/common.css +1 -1
- data/templates/default/fulldoc/html/css/full_list.css +201 -53
- data/templates/default/fulldoc/html/css/style.css +988 -389
- data/templates/default/fulldoc/html/js/app.js +800 -578
- data/templates/default/fulldoc/html/js/full_list.js +333 -341
- data/templates/default/layout/html/layout.erb +3 -1
- data/templates/guide/fulldoc/html/css/style.css +347 -97
- data/templates/guide/fulldoc/html/js/app.js +61 -64
- data/templates/guide/layout/html/layout.erb +67 -68
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60d3b726173ec326d88ee6b893b7a4f83776601ad52686c3ddcf2c7dd40522ea
|
|
4
|
+
data.tar.gz: 2d5d0b74bbb12f6c01556c5cd774876e997d777c5ec5c8dd2b5fc5763b03c250
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af71bc2ead0fcc45dcf67c4e8da45eeeff4159c8d9b4d83aba8b23ddfe328fd57f1c75b908ae2c96566bb2d882a936ebac09729cd90f73265c321a86b5a3966b
|
|
7
|
+
data.tar.gz: 518398b298dba0a9250434e426e14cd84642dee10d5fc4a769f11492783f7e5392933bbd451613a4f1d4b0e0cbf3b8f2541c85e9dcbb3d06c1f7ff47944231eb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# main
|
|
2
2
|
|
|
3
|
+
# [0.9.42] - April 16th, 2026
|
|
4
|
+
|
|
5
|
+
[0.9.42]: https://github.com/lsegal/yard/compare/v0.9.41...v0.9.42
|
|
6
|
+
|
|
7
|
+
- Fix alternating rows when loading a module in default HTML templates with subelements in the nav frame
|
|
8
|
+
- Fix reliability of keypresses and copy/paste in search box (#1174)
|
|
9
|
+
- Fix regression in `yard server` search box styling
|
|
10
|
+
- Fix possible path traversal with document_root (`--docroot`) set in `yard server` ([GHSA-xfhh-rx56-rxcr](https://github.com/lsegal/yard/security/advisories/GHSA-xfhh-rx56-rxcr))
|
|
11
|
+
|
|
12
|
+
# [0.9.41] - April 14th, 2026
|
|
13
|
+
|
|
14
|
+
[0.9.41]: https://github.com/lsegal/yard/compare/v0.9.40...v0.9.41
|
|
15
|
+
|
|
16
|
+
- Add support for `rdoc-image:...` syntax in HybridMarkup (#1676)
|
|
17
|
+
- Add support for colon suffix code blocks in HybridMarkup (rdoc compatibility)
|
|
18
|
+
- Fix responsiveness and state issues with nav frame links in `yard server`
|
|
19
|
+
|
|
3
20
|
# [0.9.40] - April 12th, 2026
|
|
4
21
|
|
|
5
22
|
[0.9.40]: https://github.com/lsegal/yard/compare/v0.9.39...v0.9.40
|
data/docs/Parser.md
CHANGED
|
@@ -55,49 +55,10 @@ You can also provide the parser type explicitly as the second argument:
|
|
|
55
55
|
Note that these two methods are aliased as {YARD.parse} and {YARD.parse_string} for
|
|
56
56
|
convenience.
|
|
57
57
|
|
|
58
|
-
##
|
|
59
|
-
|
|
60
|
-
To implement a custom parser, subclass {YARD::Parser::Base}. Documentation on which
|
|
61
|
-
abstract methods should be implemented are documented in that class. After the class
|
|
62
|
-
is implemented, it is registered with the {YARD::Parser::SourceParser} factory class
|
|
63
|
-
to be called when a file of the right extension needs to be parsed, or when a user
|
|
64
|
-
selects that parser type explicitly. To register your new parser class, call the
|
|
65
|
-
method {YARD::Parser::SourceParser.register_parser_type}:
|
|
66
|
-
|
|
67
|
-
SourceParser.register_parser_type(:my_parser, MyParser, 'my_parser_ext')
|
|
68
|
-
|
|
69
|
-
The last argument can be a single extension, a list of extensions (Array), a single Regexp, or a
|
|
70
|
-
list of Regexps. Do not include the '.' in the extension.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## The Two Ruby Parser Types
|
|
74
|
-
|
|
75
|
-
When parsing Ruby, the SourceParser can either instantiate the new {YARD::Parser::Ruby::RubyParser}
|
|
76
|
-
class or the {YARD::Parser::Ruby::Legacy::StatementList} class. The first of the
|
|
77
|
-
two, although faster, more robust and more efficient, is only available for
|
|
78
|
-
Ruby 1.9. The legacy parser parser is available in both 1.8.x and 1.9, if
|
|
79
|
-
compatibility is required. The choice of parser will affect which handlers
|
|
80
|
-
ultimately get used, since new handlers can only use the new parser and the
|
|
81
|
-
same requirement applies to the legacy parser & handlers.
|
|
82
|
-
|
|
83
|
-
## Switching to Legacy Parser
|
|
84
|
-
|
|
85
|
-
By default, running YARD under Ruby 1.9 will automatically select the new parser
|
|
86
|
-
and new handlers by extension. Although YARD supports both handler styles, plugins
|
|
87
|
-
may choose to only implement one of the two (though this is not recommended). If
|
|
88
|
-
only the legacy handlers are implemented, the `SourceParser` class should force
|
|
89
|
-
the use of the legacy parser by setting the `parser_type` attribute as such:
|
|
58
|
+
## RubyParser
|
|
90
59
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
The default value is `:ruby`. Note that this cannot be forced the other way around,
|
|
94
|
-
a parser type of `:ruby` cannot be set under Ruby 1.8.x as the new parser is not
|
|
95
|
-
supported under 1.8.
|
|
96
|
-
|
|
97
|
-
## RubyParser (the New Parser)
|
|
98
|
-
|
|
99
|
-
The new Ruby parser uses the Ripper library that is packaged as part of stdlib
|
|
100
|
-
in Ruby 1.9. Because of this, it can generate an AST from a string of Ruby input
|
|
60
|
+
The Ruby parser uses the Ripper library that is packaged as part of stdlib.
|
|
61
|
+
Because of this, it can generate an AST from a string of Ruby input
|
|
101
62
|
that is similar to the style of other sexp libraries (such as ParseTree). Each
|
|
102
63
|
node generated in the tree is of the base type {YARD::Parser::Ruby::AstNode},
|
|
103
64
|
which has some subclasses for common node types.
|
|
@@ -163,6 +124,20 @@ to quickly get at a node of a specific type in such a situation:
|
|
|
163
124
|
Multiple types can be searched for at once. If none are found, the original root
|
|
164
125
|
node is returned so that it may be chained.
|
|
165
126
|
|
|
127
|
+
## Implementing and Registering a Custom Parser
|
|
128
|
+
|
|
129
|
+
To implement a custom parser, subclass {YARD::Parser::Base}. Documentation on which
|
|
130
|
+
abstract methods should be implemented are documented in that class. After the class
|
|
131
|
+
is implemented, it is registered with the {YARD::Parser::SourceParser} factory class
|
|
132
|
+
to be called when a file of the right extension needs to be parsed, or when a user
|
|
133
|
+
selects that parser type explicitly. To register your new parser class, call the
|
|
134
|
+
method {YARD::Parser::SourceParser.register_parser_type}:
|
|
135
|
+
|
|
136
|
+
SourceParser.register_parser_type(:my_parser, MyParser, 'my_parser_ext')
|
|
137
|
+
|
|
138
|
+
The last argument can be a single extension, a list of extensions (Array), a single Regexp, or a
|
|
139
|
+
list of Regexps. Do not include the '.' in the extension.
|
|
140
|
+
|
|
166
141
|
## The Legacy Parser
|
|
167
142
|
|
|
168
143
|
The goal of the legacy parser is much the same as the new parser, but it is far
|
|
@@ -88,7 +88,7 @@ module YARD
|
|
|
88
88
|
# of status, headers, and body wrapped in an array.
|
|
89
89
|
def call(request)
|
|
90
90
|
self.request = request
|
|
91
|
-
self.path ||= request.path_info[1..-1]
|
|
91
|
+
self.path ||= File.cleanpath(request.path_info[1..-1])
|
|
92
92
|
self.headers = {'Content-Type' => 'text/html'}
|
|
93
93
|
self.body = ''
|
|
94
94
|
self.status = 200
|
|
@@ -1,96 +1,30 @@
|
|
|
1
|
-
#search_results h1 { margin-bottom: 0; }
|
|
2
|
-
#search_results p { margin-top: 0; margin-bottom: 25px; }
|
|
3
|
-
#search_results ul { list-style-position: inside; padding-left: 0; list-style: none; }
|
|
4
|
-
#search_results ul li { padding: 7px 15px; font-size: 1.1em; }
|
|
5
|
-
|
|
6
|
-
form.search {
|
|
7
|
-
z-index: 8000;
|
|
8
|
-
position: absolute;
|
|
9
|
-
color: #fff;
|
|
10
|
-
border: 1px solid #99f; width: 210px; background: #05a;
|
|
11
|
-
border-radius: 4px; border-top-left-radius: 0; border-top-right-radius: 0;
|
|
12
|
-
}
|
|
13
|
-
form.search input {
|
|
14
|
-
height: 25px;
|
|
15
|
-
padding: 0;
|
|
16
|
-
padding-left: 4px;
|
|
17
|
-
margin: 4px;
|
|
18
|
-
margin-right: 0;
|
|
19
|
-
width: 202px;
|
|
20
|
-
border: 1px solid #99f;
|
|
21
|
-
border-radius: 3px;
|
|
22
|
-
font-size: 1.1em;
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
-webkit-appearance: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@media (max-width: 920px) {
|
|
28
|
-
form.search {
|
|
29
|
-
position: absolute;
|
|
30
|
-
color: #fff;
|
|
31
|
-
width: 100%;
|
|
32
|
-
margin-top: 0;
|
|
33
|
-
background: #05a;
|
|
34
|
-
border-radius: 0;
|
|
35
|
-
border: 0;
|
|
36
|
-
margin-bottom: 10px;
|
|
37
|
-
left: 0;
|
|
38
|
-
top: 0;
|
|
39
|
-
}
|
|
40
|
-
form.search input {
|
|
41
|
-
margin-top: 9px;
|
|
42
|
-
margin-bottom: 11px;
|
|
43
|
-
margin-left: 12px;
|
|
44
|
-
padding-left: 6px;
|
|
45
|
-
border: 1px solid #eaf0ff;
|
|
46
|
-
}
|
|
47
|
-
#menu { margin-top: 41px; }
|
|
48
|
-
#search a {
|
|
49
|
-
border-top-left-radius: 3px; border-top-right-radius: 3px;
|
|
50
|
-
background: none;
|
|
51
|
-
border: 0;
|
|
52
|
-
box-shadow: none;
|
|
53
|
-
margin-top: 4px;
|
|
54
|
-
padding-bottom: 5px;
|
|
55
|
-
color: #eaf0ff; fill: #eaf0ff;
|
|
56
|
-
}
|
|
57
|
-
#search a.active {
|
|
58
|
-
background: #048; border: 0;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@media (min-width: 920px) {
|
|
63
|
-
form.search { right: 12px; top: 0; }
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#menu { padding-top: 5px; }
|
|
67
|
-
#content h1 { margin-top: 15px; border-top: 0; }
|
|
68
|
-
|
|
69
|
-
#content.error { font-size: 1.2em; }
|
|
70
|
-
#content.error p tt { font-size: 1.2em; }
|
|
71
|
-
#content.error .note { padding: 12px; }
|
|
72
|
-
|
|
73
|
-
.signature .permalink { float: right; font-size: 0.9em; }
|
|
74
|
-
|
|
75
1
|
/* autocomplete */
|
|
76
2
|
.ac_results {
|
|
77
3
|
padding: 0px;
|
|
78
|
-
|
|
79
|
-
|
|
4
|
+
position: absolute;
|
|
5
|
+
top: calc(100% - 1px);
|
|
6
|
+
left: 4px;
|
|
7
|
+
right: 4px;
|
|
8
|
+
border: 1px solid #0a4f8a;
|
|
9
|
+
width: auto;
|
|
80
10
|
overflow: hidden;
|
|
81
11
|
z-index: 99999;
|
|
12
|
+
background: #f7fbff;
|
|
13
|
+
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
|
|
14
|
+
border-radius: 0 0 4px 4px;
|
|
15
|
+
color: #123;
|
|
82
16
|
}
|
|
83
17
|
|
|
84
18
|
.ac_results ul {
|
|
85
19
|
width: 100%;
|
|
86
|
-
list-style-position: outside;
|
|
87
20
|
list-style: none;
|
|
21
|
+
list-style-position: outside;
|
|
88
22
|
padding: 0;
|
|
89
23
|
margin: 0;
|
|
90
24
|
}
|
|
91
25
|
|
|
92
26
|
.ac_results li {
|
|
93
|
-
|
|
27
|
+
cursor: pointer;
|
|
94
28
|
margin: 0px;
|
|
95
29
|
padding: 3px;
|
|
96
30
|
display: block;
|
|
@@ -98,30 +32,176 @@ form.search input {
|
|
|
98
32
|
font-size: 12px;
|
|
99
33
|
line-height: 16px;
|
|
100
34
|
overflow: hidden;
|
|
35
|
+
color: #123;
|
|
36
|
+
}
|
|
101
37
|
|
|
38
|
+
#search_results h1 {
|
|
39
|
+
margin-bottom: 0;
|
|
40
|
+
}
|
|
41
|
+
#search_results p {
|
|
42
|
+
margin-top: 0;
|
|
43
|
+
margin-bottom: 25px;
|
|
44
|
+
}
|
|
45
|
+
#search_results ul {
|
|
46
|
+
list-style: none;
|
|
47
|
+
list-style-position: inside;
|
|
48
|
+
padding-left: 0;
|
|
49
|
+
}
|
|
50
|
+
#search_results ul li {
|
|
51
|
+
padding: 7px 15px;
|
|
52
|
+
font-size: 1.1em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
form.search {
|
|
56
|
+
z-index: 8000;
|
|
57
|
+
position: absolute;
|
|
58
|
+
color: #fff;
|
|
59
|
+
border: 1px solid #99f;
|
|
60
|
+
width: 210px;
|
|
61
|
+
background: #05a;
|
|
62
|
+
border-radius: 4px;
|
|
63
|
+
border-top-left-radius: 0;
|
|
64
|
+
border-top-right-radius: 0;
|
|
65
|
+
}
|
|
66
|
+
form.search input {
|
|
67
|
+
height: 25px;
|
|
68
|
+
padding: 0;
|
|
69
|
+
padding-left: 4px;
|
|
70
|
+
margin: 4px;
|
|
71
|
+
margin-right: 0;
|
|
72
|
+
width: 202px;
|
|
73
|
+
border: 1px solid #99f;
|
|
74
|
+
border-radius: 3px;
|
|
75
|
+
font-size: 1.1em;
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
-webkit-appearance: none;
|
|
78
|
+
color: #123;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (max-width: 920px) {
|
|
82
|
+
form.search {
|
|
83
|
+
position: absolute;
|
|
84
|
+
color: #fff;
|
|
85
|
+
width: 100%;
|
|
86
|
+
margin-top: 0;
|
|
87
|
+
background: #05a;
|
|
88
|
+
border-radius: 0;
|
|
89
|
+
border: 0;
|
|
90
|
+
margin-bottom: 10px;
|
|
91
|
+
left: 0;
|
|
92
|
+
top: 0;
|
|
93
|
+
}
|
|
94
|
+
form.search input {
|
|
95
|
+
margin-top: 9px;
|
|
96
|
+
margin-bottom: 11px;
|
|
97
|
+
margin-left: 12px;
|
|
98
|
+
padding-left: 6px;
|
|
99
|
+
border: 1px solid #eaf0ff;
|
|
100
|
+
background: #fff;
|
|
101
|
+
}
|
|
102
|
+
#menu {
|
|
103
|
+
margin-top: 41px;
|
|
104
|
+
}
|
|
105
|
+
#search a {
|
|
106
|
+
border-top-left-radius: 3px;
|
|
107
|
+
border-top-right-radius: 3px;
|
|
108
|
+
background: none;
|
|
109
|
+
border: 0;
|
|
110
|
+
box-shadow: none;
|
|
111
|
+
margin-top: 4px;
|
|
112
|
+
padding-bottom: 5px;
|
|
113
|
+
color: #eaf0ff;
|
|
114
|
+
fill: #eaf0ff;
|
|
115
|
+
}
|
|
116
|
+
#search a.active {
|
|
117
|
+
background: #048;
|
|
118
|
+
border: 0;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@media (min-width: 920px) {
|
|
123
|
+
form.search {
|
|
124
|
+
right: 12px;
|
|
125
|
+
top: 0;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#menu {
|
|
130
|
+
padding-top: 5px;
|
|
131
|
+
}
|
|
132
|
+
#content h1 {
|
|
133
|
+
margin-top: 15px;
|
|
134
|
+
border-top: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
#content.error {
|
|
138
|
+
font-size: 1.2em;
|
|
139
|
+
}
|
|
140
|
+
#content.error p tt {
|
|
141
|
+
font-size: 1.2em;
|
|
142
|
+
}
|
|
143
|
+
#content.error .note {
|
|
144
|
+
padding: 12px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.signature .permalink {
|
|
148
|
+
float: right;
|
|
149
|
+
font-size: 0.9em;
|
|
102
150
|
}
|
|
103
151
|
|
|
104
152
|
.ac_loading {
|
|
105
|
-
background: white url(
|
|
153
|
+
background: white url("/images/processing.gif") right center no-repeat;
|
|
106
154
|
}
|
|
107
155
|
|
|
108
156
|
.ac_even {
|
|
109
|
-
|
|
157
|
+
background: #fafafa;
|
|
158
|
+
border: 1px dotted #fafafa;
|
|
159
|
+
border-left-width: 0;
|
|
160
|
+
border-right-width: 0;
|
|
110
161
|
}
|
|
111
162
|
|
|
112
163
|
.ac_odd {
|
|
113
|
-
background: #f0f0f0;
|
|
164
|
+
background: #f0f0f0;
|
|
165
|
+
border: 1px dotted #f0f0f0;
|
|
166
|
+
border-left-width: 0;
|
|
167
|
+
border-right-width: 0;
|
|
114
168
|
}
|
|
115
169
|
|
|
116
170
|
.ac_over {
|
|
117
|
-
|
|
171
|
+
background: #cfe5ff;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
border: 1px dotted #f7fbff;
|
|
174
|
+
border-left-width: 0;
|
|
175
|
+
border-right-width: 0;
|
|
118
176
|
}
|
|
119
177
|
|
|
120
|
-
#fade {
|
|
178
|
+
#fade {
|
|
179
|
+
display: none;
|
|
180
|
+
position: absolute;
|
|
181
|
+
top: 0px;
|
|
182
|
+
left: 0;
|
|
183
|
+
background: #eee;
|
|
184
|
+
z-index: -1;
|
|
185
|
+
width: 100%;
|
|
186
|
+
height: 100%;
|
|
187
|
+
border-top: 1px solid #e0e0e0;
|
|
188
|
+
}
|
|
121
189
|
#processing {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
190
|
+
position: absolute;
|
|
191
|
+
width: 400px;
|
|
192
|
+
height: 200px;
|
|
193
|
+
margin: auto;
|
|
194
|
+
background: #fff;
|
|
195
|
+
padding: 10px 30px;
|
|
196
|
+
z-index: 20;
|
|
197
|
+
-webkit-box-shadow: 0px 0px 20px #444;
|
|
198
|
+
-moz-box-shadow: 0px 0px 20px #444;
|
|
199
|
+
-webkit-border-radius: 4px;
|
|
200
|
+
display: none;
|
|
201
|
+
}
|
|
202
|
+
#processing img {
|
|
203
|
+
display: block;
|
|
204
|
+
position: absolute;
|
|
205
|
+
bottom: 30px;
|
|
206
|
+
left: 44%;
|
|
126
207
|
}
|
|
127
|
-
#processing img { display: block; position: absolute; bottom: 30px; left: 44%; }
|