[ruby/rdoc] Make each commit entries h3

https://github.com/ruby/rdoc/commit/11eefb2ae9
This commit is contained in:
Nobuyoshi Nakada 2021-01-21 19:43:02 +09:00
parent bb570ce6d8
commit b88d1e6b44
2 changed files with 10 additions and 14 deletions

View File

@ -226,13 +226,13 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
def create_entries entries def create_entries entries
# git log entries have no strictly itemized style like the old # git log entries have no strictly itemized style like the old
# style, just assume Markdown. # style, just assume Markdown.
entries.map do |entry, (author, date, body)| out = []
list = RDoc::Markup::List.new(:NOTE) entries.each do |entry, (author, date, body)|
author = RDoc::Markup::Paragraph.new(author) title = RDoc::Markup::Heading.new(3, "#{date} #{author}")
list << RDoc::Markup::ListItem.new(date, author) out << title
RDoc::Markdown.parse(body).parts.each {|b| list << b} out.concat RDoc::Markdown.parse(body).parts
list
end end
out
end end
end end
end end

View File

@ -349,16 +349,12 @@ ChangeLog
blank_line, blank_line,
head(2, '2021-01-21'), head(2, '2021-01-21'),
blank_line, blank_line,
list(:NOTE, head(3, '2021-01-21 01:03:52 +0900 git <svn-admin@ruby-lang.org>'),
item('2021-01-21 01:03:52 +0900', list(:BULLET, item(nil, para('2021-01-21 [ci skip]'))),
para('git <svn-admin@ruby-lang.org>')),
list(:BULLET, item(nil, para('2021-01-21 [ci skip]')))),
head(2, '2021-01-20'), head(2, '2021-01-20'),
blank_line, blank_line,
list(:NOTE, head(3, '2021-01-20 01:58:26 +0900 git <svn-admin@ruby-lang.org>'),
item('2021-01-20 01:58:26 +0900', list(:BULLET, item(nil, para('2021-01-20 [ci skip]'))))
para('git <svn-admin@ruby-lang.org>')),
list(:BULLET, item(nil, para('2021-01-20 [ci skip]')))))
expected.file = @top_level expected.file = @top_level