[前][次][番号順一覧][スレッド一覧]

ruby-changes:65024

From: Nobuyoshi <ko1@a...>
Date: Sun, 24 Jan 2021 16:53:50 +0900 (JST)
Subject: [ruby-changes:65024] b88d1e6b44 (master): [ruby/rdoc] Make each commit entries h3

https://git.ruby-lang.org/ruby.git/commit/?id=b88d1e6b44

From b88d1e6b44164bca0c2b85ea6639469813e1e1d8 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 21 Jan 2021 19:43:02 +0900
Subject: [ruby/rdoc] Make each commit entries h3

https://github.com/ruby/rdoc/commit/11eefb2ae9
---
 lib/rdoc/parser/changelog.rb            | 12 ++++++------
 test/rdoc/test_rdoc_parser_changelog.rb | 12 ++++--------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/lib/rdoc/parser/changelog.rb b/lib/rdoc/parser/changelog.rb
index 3634b6a..763ba03 100644
--- a/lib/rdoc/parser/changelog.rb
+++ b/lib/rdoc/parser/changelog.rb
@@ -226,13 +226,13 @@ class RDoc::Parser::ChangeLog < RDoc::Parser https://github.com/ruby/ruby/blob/trunk/lib/rdoc/parser/changelog.rb#L226
     def create_entries entries
       # git log entries have no strictly itemized style like the old
       # style, just assume Markdown.
-      entries.map do |entry, (author, date, body)|
-        list = RDoc::Markup::List.new(:NOTE)
-        author = RDoc::Markup::Paragraph.new(author)
-        list << RDoc::Markup::ListItem.new(date, author)
-        RDoc::Markdown.parse(body).parts.each {|b| list << b}
-        list
+      out = []
+      entries.each do |entry, (author, date, body)|
+        title = RDoc::Markup::Heading.new(3, "#{date} #{author}")
+        out << title
+        out.concat RDoc::Markdown.parse(body).parts
       end
+      out
     end
   end
 end
diff --git a/test/rdoc/test_rdoc_parser_changelog.rb b/test/rdoc/test_rdoc_parser_changelog.rb
index 33e59ac..220f008 100644
--- a/test/rdoc/test_rdoc_parser_changelog.rb
+++ b/test/rdoc/test_rdoc_parser_changelog.rb
@@ -349,16 +349,12 @@ ChangeLog https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_parser_changelog.rb#L349
       blank_line,
       head(2, '2021-01-21'),
       blank_line,
-      list(:NOTE,
-        item('2021-01-21 01:03:52 +0900',
-          para('git <svn-admin@r...>')),
-        list(:BULLET, item(nil, para('2021-01-21 [ci skip]')))),
+      head(3, '2021-01-21 01:03:52 +0900 git <svn-admin@r...>'),
+      list(:BULLET, item(nil, para('2021-01-21 [ci skip]'))),
       head(2, '2021-01-20'),
       blank_line,
-      list(:NOTE,
-        item('2021-01-20 01:58:26 +0900',
-          para('git <svn-admin@r...>')),
-        list(:BULLET, item(nil, para('2021-01-20 [ci skip]')))))
+      head(3, '2021-01-20 01:58:26 +0900 git <svn-admin@r...>'),
+      list(:BULLET, item(nil, para('2021-01-20 [ci skip]'))))
 
     expected.file = @top_level
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]