Class: RubyCode::Views::Cli::ResponseBox
- Inherits:
-
Object
- Object
- RubyCode::Views::Cli::ResponseBox
- Defined in:
- lib/rubycode/views/cli/response_box.rb
Overview
Builds response box with markdown rendering
Class Method Summary collapse
Class Method Details
.build(response:) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rubycode/views/cli/response_box.rb', line 11 def self.build(response:) pastel = Pastel.new header = "\n#{pastel.magenta("╔═══ Agent Response ═══")}" = pastel.magenta("╚══════════════════════") # Try to parse as markdown, fallback to plain content = begin TTY::Markdown.parse(response, width: 80) rescue StandardError response end "#{header}\n#{content}\n#{}" end |