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