Skip to content

Commit 2fb97c3

Browse files
committed
Merge branch 'master' into rorvswild_theme
2 parents 2e4f920 + b53f0cb commit 2fb97c3

File tree

8 files changed

+76
-15
lines changed

8 files changed

+76
-15
lines changed

lib/rdoc/generator/template/darkfish/css/rdoc.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
--color-primary: oklch(0.5 0.18 29);
1212
--color-primary-hover: oklch(0.4 0.18 29);
13-
--color-strong-background: oklch(0.97 0.05 89);
13+
--color-strong-background: oklch(0.97 0.03 59);
1414
--color-topbar: var(--color-primary);
1515
--color-topbar-text: var(--color-background);
16-
--color-text: oklch(0.36 0.03 269);
17-
--color-text-light: oklch(0.46 0.03 269);
18-
--color-title: oklch(0.26 0.03 269);
16+
--color-text: oklch(0.4 0.03 269);
17+
--color-text-light: oklch(0.5 0.03 269);
18+
--color-title: oklch(0.27 0.03 269);
1919
--color-background: oklch(0.99 0.001 269);
2020
--color-code-background: oklch(0.97 0.002 269);
2121
--color-th-background: oklch(0.95 0.002 269);
@@ -202,7 +202,7 @@ details > summary::after {
202202
flex-shrink: 0;
203203
cursor: pointer;
204204
position: relative;
205-
top: 1px;
205+
top: 2px;
206206
margin-left: auto;
207207
}
208208

@@ -238,7 +238,7 @@ main h2 {
238238
font-size: 1.44rem;
239239
line-height: 3rem;
240240
color: var(--color-title);
241-
box-shadow: 0 2px 0 0 var(--color-text);
241+
box-shadow: 0 1px 0 0 var(--color-text-light);
242242
}
243243

244244
main h3 {
@@ -811,7 +811,7 @@ pre + .toggle-source { margin-top: 0.5rem; }
811811
--color-primary: oklch(0.85 0.09 29);
812812
--color-primary-hover: oklch(87.78296875% 0.07 29);
813813

814-
--color-strong-background: oklch(0.28 0.06 89);
814+
--color-strong-background: oklch(0.27 0.04 59);
815815

816816
--color-topbar: oklch(0.5 0.18 29);
817817
--color-topbar-text: oklch(0.99 0.001 269);

lib/rdoc/markup/to_rdoc.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ def accept_verbatim verbatim
249249
# Adds +table+ to the output
250250

251251
def accept_table header, body, aligns
252-
widths = header.zip(body) do |h, b|
253-
[h.size, b.size].max
252+
widths = header.zip(*body).map do |cols|
253+
cols.map(&:size).max
254254
end
255255
aligns = aligns.map do |a|
256256
case a
@@ -262,12 +262,12 @@ def accept_table header, body, aligns
262262
:rjust
263263
end
264264
end
265-
@res << header.zip(widths, aligns) do |h, w, a|
265+
@res << header.zip(widths, aligns).map do |h, w, a|
266266
h.__send__(a, w)
267267
end.join("|").rstrip << "\n"
268268
@res << widths.map {|w| "-" * w }.join("|") << "\n"
269269
body.each do |row|
270-
@res << row.zip(widths, aligns) do |t, w, a|
270+
@res << row.zip(widths, aligns).map do |t, w, a|
271271
t.__send__(a, w)
272272
end.join("|").rstrip << "\n"
273273
end

test/rdoc/support/text_formatter_test_case.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,23 @@ def test_accept_paragraph_wrap
9999
accept_paragraph_wrap
100100
end
101101

102+
##
103+
# Test case that calls <tt>@to.accept_table</tt>
104+
105+
def test_accept_table_align
106+
header = ['AA', 'BB', 'CCCCC']
107+
body = [
108+
['', 'bbb', 'c'],
109+
['aaaa', 'b', ''],
110+
['a', '', 'cc']
111+
]
112+
aligns = [nil, :left, :right]
113+
@to.start_accepting
114+
@to.accept_table header, body, aligns
115+
116+
accept_table_align
117+
end
118+
102119
##
103120
# Test case that calls <tt>@to.attributes</tt> with an escaped
104121
# cross-reference. If this test doesn't pass something may be very

test/rdoc/test_rdoc_markup_to_ansi.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,17 @@ def list_verbatim
348348
assert_equal expected, @to.end_accepting
349349
end
350350

351+
def accept_table_align
352+
expected = "\e[0m" + <<-EXPECTED
353+
AA |BB |CCCCC
354+
----|---|-----
355+
|bbb| c
356+
aaaa|b |
357+
a | | cc
358+
EXPECTED
359+
assert_equal expected, @to.end_accepting
360+
end
361+
351362
# functional test
352363
def test_convert_list_note
353364
note_list = <<-NOTE_LIST

test/rdoc/test_rdoc_markup_to_bs.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,15 @@ def list_verbatim
349349
assert_equal expected, @to.end_accepting
350350
end
351351

352+
def accept_table_align
353+
expected = <<-EXPECTED
354+
AA |BB |CCCCC
355+
----|---|-----
356+
|bbb| c
357+
aaaa|b |
358+
a | | cc
359+
EXPECTED
360+
assert_equal expected, @to.end_accepting
361+
end
362+
352363
end

test/rdoc/test_rdoc_markup_to_markdown.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,17 @@ def list_verbatim
346346
assert_equal expected, @to.end_accepting
347347
end
348348

349+
def accept_table_align
350+
expected = <<-EXPECTED
351+
AA |BB |CCCCC
352+
----|---|-----
353+
|bbb| c
354+
aaaa|b |
355+
a | | cc
356+
EXPECTED
357+
assert_equal expected, @to.end_accepting
358+
end
359+
349360
def test_convert_RDOCLINK
350361
result = @to.convert 'rdoc-garbage:C'
351362

test/rdoc/test_rdoc_markup_to_rdoc.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,17 @@ def list_verbatim
346346
assert_equal expected, @to.end_accepting
347347
end
348348

349+
def accept_table_align
350+
expected = <<-EXPECTED
351+
AA |BB |CCCCC
352+
----|---|-----
353+
|bbb| c
354+
aaaa|b |
355+
a | | cc
356+
EXPECTED
357+
assert_equal expected, @to.end_accepting
358+
end
359+
349360
# functional test
350361
def test_convert_list_note
351362
note_list = <<-NOTE_LIST

test/rdoc/test_rdoc_ri_driver.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ def test_self_dump
5454
RDoc::RI::Driver.dump @store1.cache_path
5555
end
5656

57-
assert_match %r%:class_methods%, out
58-
assert_match %r%:modules%, out
59-
assert_match %r%:instance_methods%, out
60-
assert_match %r%:ancestors%, out
57+
assert_match %r%:class_methods|class_methods:%, out
58+
assert_match %r%:modules|modules:%, out
59+
assert_match %r%:instance_methods|instance_methods:%, out
60+
assert_match %r%:ancestors|ancestors:%, out
6161
end
6262

6363
def test_add_also_in_empty

0 commit comments

Comments
 (0)