Skip to content

Commit cede785

Browse files
Merge pull request #29 from programmablemd/develop
feat: rb documentatiomn
2 parents ca66bb9 + a84c993 commit cede785

15 files changed

Lines changed: 2618 additions & 622 deletions

File tree

content/docs/advanced/meta.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"icon": "Zap",
44
"pages": [
55
"best-practices",
6-
"troubleshooting"
6+
"troubleshooting",
7+
"rb",
8+
"rb-new"
79
],
810
"root": true
911
}

content/docs/advanced/rb-new.mdx

Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
---
2+
title: spry rb Commands
3+
description: Complete reference for spry rb command-line tools
4+
---
5+
6+
import { Tabs, Tab } from 'fumadocs-ui/components/tabs';
7+
import { Callout } from 'fumadocs-ui/components/callout';
8+
9+
## spry rb ls
10+
11+
List all tasks in markdown files.
12+
13+
```bash
14+
spry rb ls [paths...]
15+
```
16+
17+
### Options
18+
19+
- `--no-color` - Output without ANSI colors
20+
21+
### Examples
22+
23+
<Tabs items={['Basic', 'Specific File', 'Multiple Files', 'No Color']}>
24+
<Tab value="Basic">
25+
```bash
26+
spry rb ls
27+
```
28+
List all tasks in the current directory.
29+
</Tab>
30+
<Tab value="Specific File">
31+
```bash
32+
spry rb ls Spryfile.md
33+
```
34+
List tasks from a specific file.
35+
</Tab>
36+
<Tab value="Multiple Files">
37+
```bash
38+
spry rb ls *.md
39+
```
40+
List tasks from all markdown files.
41+
</Tab>
42+
<Tab value="No Color">
43+
```bash
44+
spry rb ls --no-color
45+
```
46+
Output without ANSI colors.
47+
</Tab>
48+
</Tabs>
49+
50+
---
51+
52+
## spry rb task
53+
54+
Execute specific task and its dependencies.
55+
56+
```bash
57+
spry rb task <taskId> [paths...]
58+
```
59+
60+
### Options
61+
62+
- `--verbose <style>` - Output format: `plain` (simple text), `rich` (colored/formatted), `markdown` (markdown formatted)
63+
- `--summarize` - Generate JSON summary of execution results
64+
65+
### Examples
66+
67+
<Tabs items={['Basic', 'Verbose', 'Summary', 'Combined']}>
68+
<Tab value="Basic">
69+
```bash
70+
spry rb task task-1
71+
```
72+
Run a specific task.
73+
</Tab>
74+
<Tab value="Verbose">
75+
```bash
76+
spry rb task task-1 --verbose rich
77+
```
78+
Run with detailed colored output.
79+
</Tab>
80+
<Tab value="Summary">
81+
```bash
82+
spry rb task task-1 --summarize
83+
```
84+
Run with JSON summary of results.
85+
</Tab>
86+
<Tab value="Combined">
87+
```bash
88+
spry rb task task-1 --verbose rich --summarize
89+
```
90+
Run with all options enabled.
91+
</Tab>
92+
</Tabs>
93+
94+
---
95+
96+
## spry rb run
97+
98+
Execute all code cells in markdown documents as a DAG (Directed Acyclic Graph).
99+
100+
```bash
101+
spry rb run [paths...]
102+
```
103+
104+
### Options
105+
106+
- `-h, --help` - Show help information
107+
- `--verbose <style>` - Emit information messages verbosely
108+
- `plain` - Plain text output
109+
- `rich` - Colorized/formatted output
110+
- `markdown` - Markdown formatted output
111+
- `--graph <name>` - Run only nodes in provided graph(s)
112+
- `--summarize` - Emit summary after execution in JSON format
113+
- `--visualize <style>` - Visualize the DAG before/during execution
114+
- `ascii-tree` - Tree structure diagram
115+
- `ascii-workflow` - Workflow sequence diagram
116+
- `ascii-flowchart` - Detailed flowchart format
117+
- `mermaid-js` - Mermaid graph syntax
118+
119+
### Examples
120+
121+
<Tabs items={['Basic', 'Verbose', 'Graphs', 'Visualization', 'Advanced']}>
122+
<Tab value="Basic">
123+
```bash
124+
# Run all tasks in order
125+
spry rb run
126+
127+
# Run from specific file
128+
spry rb run Spryfile.md
129+
```
130+
</Tab>
131+
<Tab value="Verbose">
132+
```bash
133+
# Plain text output
134+
spry rb run --verbose plain
135+
136+
# Colored detailed output
137+
spry rb run --verbose rich
138+
139+
# Markdown formatted output
140+
spry rb run --verbose markdown
141+
```
142+
</Tab>
143+
<Tab value="Graphs">
144+
```bash
145+
# Run only Graph A tasks
146+
spry rb run --graph A
147+
148+
# Run Graphs A and B
149+
spry rb run --graph "A,B"
150+
```
151+
</Tab>
152+
<Tab value="Visualization">
153+
```bash
154+
# Show task tree structure
155+
spry rb run --visualize ascii-tree
156+
157+
# Show workflow sequence
158+
spry rb run --visualize ascii-workflow
159+
160+
# Show detailed flowchart
161+
spry rb run --visualize ascii-flowchart
162+
163+
# Show Mermaid diagram
164+
spry rb run --visualize mermaid-js
165+
```
166+
</Tab>
167+
<Tab value="Advanced">
168+
```bash
169+
# JSON execution summary
170+
spry rb run --summarize
171+
172+
# Output with visualization
173+
spry rb run --verbose rich --visualize ascii-workflow
174+
175+
# Save execution log
176+
spry rb run --verbose rich --summarize > execution.json
177+
```
178+
</Tab>
179+
</Tabs>
180+
181+
---
182+
183+
## spry rb issues
184+
185+
Display errors, warnings, and validation issues in markdown documents.
186+
187+
```bash
188+
spry rb issues [paths...]
189+
```
190+
191+
### What It Detects
192+
193+
- Malformed code block syntax
194+
- Invalid task IDs
195+
- Circular dependencies
196+
- Missing task references
197+
- Duplicate task names
198+
- Syntax errors
199+
200+
### Examples
201+
202+
```bash
203+
# Check current file
204+
spry rb issues
205+
206+
# Check specific file
207+
spry rb issues Spryfile.md
208+
209+
# Check all markdown files
210+
spry rb issues *.md
211+
```
212+
213+
### Output
214+
215+
**No Issues:**
216+
```
217+
✓ No issues found
218+
```
219+
220+
**With Issues:**
221+
```
222+
Spryfile.md:
223+
Line 42: ERROR - Circular dependency: task-a → task-b → task-a
224+
Line 58: WARNING - Undefined task reference 'missing-task'
225+
Line 75: ERROR - Missing language specifier in code block
226+
```
227+
228+
### Usage Patterns
229+
230+
#### Validate Before Running
231+
232+
```bash
233+
spry rb issues && spry rb run
234+
```
235+
236+
#### In Scripts
237+
238+
```bash
239+
if spry rb issues > /dev/null; then
240+
echo "Ready to run"
241+
spry rb run
242+
else
243+
echo "Fix issues first"
244+
fi
245+
```
246+
247+
<Callout type="info">
248+
Always run `spry rb issues` before executing tasks to catch potential problems early.
249+
</Callout>
250+
251+
---
252+
253+
## spry rb report
254+
255+
Execute all code cells and return results as new markdown.
256+
257+
```bash
258+
spry rb report [paths...]
259+
```
260+
261+
### Description
262+
263+
Executes all code cells in markdown documents and generates new markdown with embedded outputs. Useful for creating executable documentation and reports with live data.
264+
265+
### Examples
266+
267+
```bash
268+
# Generate report from current directory
269+
spry rb report
270+
271+
# Generate report from specific file
272+
spry rb report Spryfile.md
273+
274+
# Generate reports from multiple files
275+
spry rb report *.md
276+
```
277+
278+
### Output Example
279+
280+
**Before:**
281+
````markdown
282+
```bash
283+
echo "Hello"
284+
```
285+
````
286+
287+
**After:**
288+
````markdown
289+
```bash
290+
echo "Hello"
291+
```
292+
```output
293+
Hello
294+
```
295+
````
296+
297+
<Callout type="warn">
298+
The `report` command will execute all code cells. Ensure your code is safe to run before generating reports.
299+
</Callout>

0 commit comments

Comments
 (0)