render_flowchart
Render flowchart
Render a FlowScript flowchart to PNG or PDF. PNG output is returned as an image so you can check the result; PDF is saved to a file. Pass output_path to save either format to disk. The result also includes a JSON layout: every node with its box (x, y, width, height in CSS px from the image top-left; multiply by scale for image pixels), the script line it came from, the edges, and detected issues ("overlap", "edge_crosses_node") with the script lines involved. Use the issues to revise the script and render again. # FlowScript language reference FlowScript is a line-based text format that renders to a left-to-right flowchart. ## Rules - **One statement per line.** Indentation and blank lines are ignored; indent only for readability. - A line is either a **keyword line** or a **process line** (any other text becomes a box). - Keywords are lowercase and must be the **first word** on the line. - **Gotcha:** a process label must not start with a keyword word. `none of the above` is read as the `none` keyword followed by a box labelled `of the above`. Reword it (`No match`) or capitalize it (`None of the above`), since keywords are case-sensitive. - Every `if`/`if2` needs a `then … endthen` block and a closing `endif`. `if` may also have one `else … endelse` block between `endthen` and `endif`. ## Keywords | Line | Renders | |---|---| | `<text>` | Process box labelled `<text>` | | `<text> (<url>)` | Process box with `<url>` shown in its footer | | `<text> <- file(<name>)` | Process box with a document node `<name>` above it, connected down to it | | `if <question>` | Decision diamond. Use with `then`/`endthen`, optional `else`/`endelse`, then `endif` | | `if2 <question>` | Decision diamond with no `else`; the "no" path continues to the next node after `endif` | | `then` / `endthen` | Start / end the "yes" branch (drawn downward) | | `else` / `endelse` | Start / end the "no" branch | | `endif` | Close the if block; the flow continues to the right | | `endflow`
scaleformatscriptrequiredoutput_pathinclude_layout