From 2fc12690fe015d5b13f42de8867762f73f2453a8 Mon Sep 17 00:00:00 2001 From: Kenshi Muto Date: Sun, 5 Apr 2020 22:15:33 +0900 Subject: [PATCH 01/16] add column-style note,memo,tip,info,warning,important,caution,notice. Closes: #1493 --- lib/review/htmlbuilder.rb | 15 +++++++++++++++ lib/review/idgxmlbuilder.rb | 15 +++++++++++++++ lib/review/latexbuilder.rb | 27 +++++++++++++++++++++++++++ lib/review/plaintextbuilder.rb | 13 +++++++++++++ lib/review/topbuilder.rb | 23 +++++++++++++++++++++++ 5 files changed, 93 insertions(+) diff --git a/lib/review/htmlbuilder.rb b/lib/review/htmlbuilder.rb index 42704b410..49d0bb25e 100644 --- a/lib/review/htmlbuilder.rb +++ b/lib/review/htmlbuilder.rb @@ -312,6 +312,21 @@ def note(lines, caption = nil) captionblock('note', lines, caption) end + %w[note memo tip info warning important caution notice].each do |name| + class_eval %Q( + def #{name}_begin(_level, _label, caption = nil) + puts %Q(
) + if caption.present? + puts %Q(

\#{compile_inline(caption)}

) + end + end + + def #{name}_end(_level) + puts '
' + end + ) + end + def ul_begin puts '