Skip to content

Commit 3be01c1

Browse files
authored
Update dog example (#181)
* Update dog example * Add dog example * Update PR number
1 parent 5a307ad commit 3be01c1

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@
1717

1818
Unlike typical notebooks (like Jupyter or Observable), Recho Notebook treats **code and its output as a single, continuous document**. When you write code, **the output appears inline — as a comment right above your code**.
1919

20-
```js
21-
//➜ "dog"
22-
const text = echo("dog");
23-
24-
//➜ [ "g", "o", "d" ]
25-
const words = echo(text.split(""));
26-
27-
//➜ "god"
28-
echo(words.reverse().join(""));
29-
```
20+
![A Quick Example](./img/dog.gif)
3021

3122
If you modify the code, the echoed output updates immediately. So instead of switching between “code cells” and “output cells,” your entire notebook feels like a living text file that responds to you.
3223

app/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const DEFAULT_CONTENT = `
2929
3030
const text = echo("dog");
3131
32-
const words = echo(text.split(""));
32+
const chars = echo(text.split(""));
3333
34-
echo(words.reverse().join(""));
34+
echo(chars.slice().reverse().join(""));
3535
3636
// 2. You can also call recho.interval(ms) to create data-driven animations,
3737
// which can help you find the minimalism of ASCII art is fascinating!

app/examples/dog.recho.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @title Dog
3+
* @author Bairui Su
4+
* @created 2025-10-21
5+
* @github pearmini
6+
* @pull_request 181
7+
* @thumbnail_start 10
8+
*/
9+
10+
/** A Quick Example! 🐶 */
11+
12+
//➜ "dog"
13+
const text = echo("dog");
14+
15+
//➜ [ "d", "o", "g" ]
16+
const chars = echo(text.split(""));
17+
18+
//➜ "god"
19+
echo(chars.slice().reverse().join(""));

img/dog.gif

603 KB
Loading

0 commit comments

Comments
 (0)