Sync format_buffer code
This commit is contained in:
parent
823cc24e8a
commit
4c46cb2958
@ -6,16 +6,17 @@ require "json"
|
||||
require "uuid"
|
||||
|
||||
class Handler
|
||||
def format_buffer(buffer, canvas_name)
|
||||
def format_buffer(buffer, canvas_name, title)
|
||||
# Process the gnuplot output so it works in the page
|
||||
#
|
||||
# buffer is the Ishi output
|
||||
# name is a string to replace for gnuplot_canvas so
|
||||
# we can have multiple charts in a page
|
||||
# we can have multiple charts in a page
|
||||
# title is added on top of the chart
|
||||
|
||||
html = buffer.to_s.split("\n")
|
||||
html = html[html.index("<script type=\"text/javascript\">")..html.index("</script>")]
|
||||
html = html.join("\n") + %(
|
||||
html = "<b>#{title}</b>" + html.join("\n") + %(
|
||||
<div class="gnuplot">
|
||||
<canvas id="Tile" width="32" height="32" hidden></canvas>
|
||||
<table class="plot">
|
||||
|
Loading…
Reference in New Issue
Block a user