Quickest Start
put("./src/") |> put_diagram()Annotation Syntax
# put id:"node_id", label:"Description", node_type:"process", input:"in.csv", output:"out.csv"
| Field | Required | Default | Description |
|---|---|---|---|
label |
Yes | - | Human-readable name |
id |
No | UUID | Unique identifier |
node_type |
No | process |
input, process, output,
decision, start, end
|
input |
No | - | Comma-separated input files |
output |
No | filename | Comma-separated output files |
Multiline: End lines with \ for
continuation.
Comment Prefixes
Find your language:
# put → R, Python, Shell, Julia, Ruby, YAML, Perl, TOML, Dockerfile, Makefile
-- put → SQL, Lua, Haskell
// put → JavaScript, TypeScript, Go, Rust, Java, C, C++, Swift, Kotlin, C#, PHP, Scala, WGSL
% put → MATLAB, LaTeX
* put → Block comments (/* */ and /** */) in all // languages
Core Functions
| Function | Purpose | Example |
|---|---|---|
put() |
Extract annotations | put("./src/") |
put_diagram() |
Generate Mermaid | put_diagram(workflow) |
put_auto() |
Auto-detect workflow | put_auto("./src/") |
put_generate() |
Suggest annotations | put_generate("./src/") |
put_merge() |
Merge manual + auto | put_merge("./src/") |
Common Patterns
Basic
put("./src/") |> put_diagram()Customize
put_diagram(wf, theme = "dark", direction = "LR")
put_diagram(wf, show_artifacts = FALSE) # Hide data files
put_diagram(wf, show_source_info = TRUE) # Show file infoSave
put_diagram(wf, output = "workflow.md")Exclude files
Debug
put("./", log_level = "DEBUG")Themes and Direction
| Theme | Use Case |
|---|---|
light |
Bright colors (default) |
dark |
Dark mode UIs |
minimal |
Print-friendly, grayscale |
github |
README files |
viridis |
Colorblind-safe (purple-blue-green-yellow) |
magma |
Colorblind-safe warm (purple-red-yellow) |
plasma |
Colorblind-safe vibrant (purple-pink-yellow) |
cividis |
Maximum accessibility (blue-yellow only) |
Directions: TD (default),
LR, BT, RL
Node Types
| Type | Shape | Use For |
|---|---|---|
input |
Stadium | Data loading |
process |
Rectangle | Transformations (default) |
output |
Subroutine | Reports, exports |
decision |
Diamond | Conditional logic |
start |
Stadium | Workflow entry point |
end |
Stadium | Workflow exit point |
artifact |
Cylinder | Data files (auto-created) |
flowchart TD
load(["input"])
transform["process"]
export[["output"]]
check{"decision"}
%% Connections
load --> transform
transform --> export
transform --> check
%% Styling
classDef inputStyle fill:#dbeafe,stroke:#2563eb,stroke-width:2px,color:#1e40af
class load inputStyle
classDef processStyle fill:#ede9fe,stroke:#7c3aed,stroke-width:2px,color:#5b21b6
class transform processStyle
classDef outputStyle fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#15803d
class export outputStyle
classDef decisionStyle fill:#fef3c7,stroke:#d97706,stroke-width:2px,color:#92400e
class check decisionStyle