Skip to main content

Module content_builders

Module content_builders 

Source
Expand description

Content namespace builder functions.

Static constructor functions for creating ContentNode values from the Content namespace. These are intended to be registered as native functions accessible from Shape code.

  • Content.text(string) — plain text node
  • Content.table(headers, rows) — table node
  • Content.chart(chart_type) — chart node (empty series)
  • Content.code(language, source) — code block
  • Content.kv(pairs) — key-value pairs
  • Content.fragment(parts) — composition of content nodes

Functions§

align_named
Align namespace: Align.left, Align.center, Align.right. Returns a ValueWord string tag for alignment directives.
border_named
Border namespace: Border.rounded, Border.sharp, etc. Returns a ValueWord string tag that content methods accept as border args.
chart_type_named
ChartType namespace: ChartType.line, ChartType.bar, etc. Returns a ValueWord string tag that content builders accept as chart type args.
color_named
Color namespace: Color.red, Color.green, etc. Returns a ValueWord string tag that content methods accept as color args.
color_rgb
Color.rgb(r, g, b) — returns an RGB color string tag “rgb(r,g,b)”.
content_chart
Create a chart ContentNode with empty series.
content_code
Create a code block ContentNode.
content_fragment
Create a fragment ContentNode (composition of multiple nodes).
content_kv
Create a key-value ContentNode.
content_table
Create a table ContentNode.
content_text
Create a plain text ContentNode.