Class: AsciidoctorDiagramLayout::Renderer::HtmlRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/asciidoctor_diagram_layout/renderer/html_renderer.rb

Constant Summary collapse

CELL_BASE =
"display:flex; align-items:center; justify-content:center;" \
" padding:8px; font-weight:bold; font-family:sans-serif;" \
" min-height:60px; box-sizing:border-box; color:#333;"

Instance Method Summary collapse

Instance Method Details

#render(root, options = RenderOptions.new) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/asciidoctor_diagram_layout/renderer/html_renderer.rb', line 8

def render(root, options = RenderOptions.new)
  sb = +""
  height_style = options.height ? " min-height:#{options.height};" : ""
  wrapper_style = "display:flex; width:#{options.width};#{height_style}" \
                  " box-sizing:border-box; font-family:sans-serif; overflow:hidden;"
  sb << "<div style=\"#{wrapper_style}\">\n"
  render_node(root, sb, 1, options)
  sb << "</div>\n"
  sb
end