@@ -13,13 +13,46 @@ function generateProjectName() {
1313 return `${ adj } -${ obj } .js` ;
1414}
1515
16+ const DEFAULT_CONTENT = `
17+ // Welcome to **Recho Notebook**!
18+ // A reactive editor for algorithms and ASCII art.
19+ // 1. You can call echo(value) to echo output inline as comments, which allows
20+ // you to better understand the code by "seeing" every manipulation in-situ.
21+
22+ const text = echo("dog");
23+
24+ const words = echo(text.split(""));
25+
26+ echo(words.reverse().join(""));
27+
28+ // 2. You can also call recho.interval(ms) to create data-driven animations,
29+ // which can help you find the minimalism of ASCII art is still fascinating!
30+
31+ const x = recho.interval(100);
32+
33+ echo("🚗💨".padStart(40 - (x % 40)));
34+
35+ // 3. Inputs are also supported, which can help you create interactive
36+ // notebooks. Click the buttons to see what happens!
37+
38+ const x1 = recho.number(10, {min: 0, max: 40, step: 1});
39+
40+ //➜ "(๑•̀ㅂ•́)و✧"
41+ echo("~".repeat(x1) + "(๑•̀ㅂ•́)و✧");
42+
43+ // Follow the links (cmd/ctrl + click) to learn more about the Recho Notebook
44+ // - Docs: https://recho.dev/notebook/docs/
45+ // - Examples: https://recho.dev/notebook/examples/
46+ // - Github: https://github.com/recho-dev/notebook
47+ ` ;
48+
1649export function createNotebook ( ) {
1750 return {
1851 id : generate ( ) ,
1952 title : generateProjectName ( ) ,
2053 created : null ,
2154 updated : null ,
22- content : `echo("Hello, world!");` ,
55+ content : DEFAULT_CONTENT . trimStart ( ) ,
2356 autoRun : true ,
2457 runtime : DEFAULT_RUNTIME ,
2558 } ;
0 commit comments