From f294bb6a68fbcd884017b45a4e276f61b5c2860b Mon Sep 17 00:00:00 2001 From: Vitalii Elenhaupt Date: Sun, 13 Jan 2019 22:14:25 +0200 Subject: [PATCH] Improve explain output --- src/ameba/formatter/explain_formatter.cr | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ameba/formatter/explain_formatter.cr b/src/ameba/formatter/explain_formatter.cr index 1c528ba2..97e35847 100644 --- a/src/ameba/formatter/explain_formatter.cr +++ b/src/ameba/formatter/explain_formatter.cr @@ -5,7 +5,8 @@ module Ameba::Formatter # a specific location. class ExplainFormatter LINE_BREAK = "\n" - PREFIX = "| ".colorize(:yellow) + HEADING = "## " + PREFIX = " " include Util @@ -64,8 +65,8 @@ module Ameba::Formatter end private def output_title(title) - output << PREFIX << title.colorize(:yellow) << LINE_BREAK - output << PREFIX << LINE_BREAK + output << HEADING.colorize(:yellow) << title.colorize(:yellow) << LINE_BREAK + output << LINE_BREAK end private def output_paragraph(paragraph : String) @@ -74,9 +75,9 @@ module Ameba::Formatter private def output_paragraph(paragraph : Array(String)) paragraph.each do |line| - output << PREFIX << PREFIX << line << LINE_BREAK + output << PREFIX << line << LINE_BREAK end - output << PREFIX << LINE_BREAK + output << LINE_BREAK end end end