require "colorize" require "./generic" module Builder class PromptString < PromptGeneric SEPARATOR = "\n\n" getter use_color : Bool def initialize(@use_color) Colorize.enabled = @use_color end def build(prompt : Prompt) str = "" str += prompt.prelude_zone.content.join(SEPARATOR) if ! prompt.system_zone.content.empty? str += "@@system".colorize(:yellow).to_s str += prompt.system_zone.content.join(SEPARATOR) end if ! prompt.past_zone.content.empty? str += "@@before".colorize(:yellow).to_s str += prompt.past_zone.content.join(SEPARATOR) end if ! prompt.present_zone.content.empty? str += "@@current".colorize(:yellow).to_s str += prompt.present_zone.content.join(SEPARATOR).colorize(:light_cyan).to_s end if ! prompt.future_zone.content.empty? str += "@@after".colorize(:yellow).to_s str += prompt.future_zone.content.join("\n") end str end end end