mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Improve explain output
This commit is contained in:
parent
3c5e3cdef4
commit
f294bb6a68
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue