4
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/trickster/renderer/commandline_renderer.rb', line 4
def render(io,content,options)
io.print "<pre><code class='no-highlight'>"
content = split_by_commands_and_results(content)
content.each do |(prompt,command,result)|
io.puts "<span class='cli-prompt'>#{prompt}</span> <span class='cli-element cli-command cli-line'>#{command}</span>"
unless result.empty?
io.puts "<span class='cli-element cli-result'>#{result.join("\n")}</span>"
end
end
io.puts "</code></pre>"
end
|