Skip to content

Commit 2462f9f

Browse files
authored
Merge pull request #101 from takker99/code-files
✨ `scrapbox.Page.lines`からコードブロックを抽出する
2 parents 84b1714 + 6c6b476 commit 2462f9f

File tree

6 files changed

+753
-3
lines changed

6 files changed

+753
-3
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
export const snapshot = {};
2+
3+
snapshot[`extractCodeFiles 1`] = `
4+
Map {
5+
"main.cpp" => {
6+
blocks: [
7+
{
8+
endId: "63b7b1261280f00000c9bc36",
9+
indent: 2,
10+
lines: [
11+
"#include <iostream>",
12+
"",
13+
],
14+
startId: "63b7b1261280f00000c9bc34",
15+
updated: 1672982822,
16+
},
17+
{
18+
endId: "63b7b1261280f00000c9bc3c",
19+
indent: 2,
20+
lines: [
21+
"int main() {",
22+
' std::cout << "Hello, C++" << "from scrapbox.io" << std::endl;',
23+
"}",
24+
"",
25+
],
26+
startId: "63b7b1261280f00000c9bc38",
27+
updated: 1672982822,
28+
},
29+
],
30+
filename: "main.cpp",
31+
lang: "cpp",
32+
},
33+
"py" => {
34+
blocks: [
35+
{
36+
endId: "63b7b1261280f00000c9bc2a",
37+
indent: 0,
38+
lines: [
39+
'print("Hello World!")',
40+
],
41+
startId: "63b7b1261280f00000c9bc29",
42+
updated: 1672982822,
43+
},
44+
],
45+
filename: "py",
46+
lang: "py",
47+
},
48+
"python" => {
49+
blocks: [
50+
{
51+
endId: "63b7b1261280f00000c9bc31",
52+
indent: 1,
53+
lines: [
54+
\`console.log("I'm JavaScript");\`,
55+
],
56+
startId: "63b7b1261280f00000c9bc30",
57+
updated: 1672982822,
58+
},
59+
],
60+
filename: "python",
61+
lang: "js",
62+
},
63+
"インデント.md" => {
64+
blocks: [
65+
{
66+
endId: "63b7b1261280f00000c9bc2e",
67+
indent: 1,
68+
lines: [
69+
"- インデント",
70+
" - インデント",
71+
],
72+
startId: "63b7b1261280f00000c9bc2c",
73+
updated: 1672982822,
74+
},
75+
],
76+
filename: "インデント.md",
77+
lang: "md",
78+
},
79+
"コードブロック.py" => {
80+
blocks: [
81+
{
82+
endId: "63b7b1261280f00000c9bc27",
83+
indent: 0,
84+
lines: [
85+
'print("Hello World!")',
86+
],
87+
startId: "63b7b1261280f00000c9bc26",
88+
updated: 1672982822,
89+
},
90+
],
91+
filename: "コードブロック.py",
92+
lang: "py",
93+
},
94+
}
95+
`;

0 commit comments

Comments
 (0)