Helpers for rendering syntax-highlighted code blocks inside graph nodes.
Summary
Functions
Formats source code for display inside a node box.
Renders a code block into a canvas region with a border.
Functions
@spec format_label( String.t(), keyword() ) :: Boxart.CodeNode.CodeLabel.t()
Formats source code for display inside a node box.
Options
:start_line— first line number (default:1):language— atom for syntax highlighting (e.g.:elixir)
Returns a %CodeLabel{} with line number / code pairs and dimensions.
@spec render_to_canvas( Boxart.Canvas.t(), integer(), integer(), integer(), integer(), Boxart.CodeNode.CodeLabel.t(), any() ) :: Boxart.Canvas.t()
Renders a code block into a canvas region with a border.