-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconvertRoamNodeToFullContent.example.ts
More file actions
233 lines (226 loc) · 7.04 KB
/
Copy pathconvertRoamNodeToFullContent.example.ts
File metadata and controls
233 lines (226 loc) · 7.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
import type { TreeNode } from "roamjs-components/types";
import type { CrossAppNode } from "@repo/database/crossAppNodeContract";
import { buildFullMarkdown } from "./convertRoamNodeToFullContent";
/**
* Typed example for ENG-1848 ("tests or fixtures cover representative Roam
* block content becoming `full` markdown"). This is not a concrete test; it
* documents the `tree.children` shape returned by `getFullTreeByParentUid` for
* a real Roam claim page and type-checks the generated markdown against the
* contract.
*
* Derived from:
* https://roamresearch.com/#/app/plugin-testing-akamatsulab2/page/dnHNmYwe5
*
* Observed markdown output:
*
* # [[CLM]] - Actin assembly peaks 8 seconds before endocytic scission
*
* - ## Source of Claim [ℹ](link to [[@source]], name, URL, etc)
* - [[[[EVD]] - Membrane invagination occurred ~6 seconds after scission protein (spHob1-GFP) was detected in budding yeast cells - [[@sun2019direct]]]]
* - [[[[EVD]] - At fission yeast endocytic sites, scission protein (spHob1) first detected ~2 seconds before initiation of membrane invagination - [[@sun2019direct]]]]
* - [[[[EVD]] - Actin appearance occurred 9 (+/-2) seconds prior to patch formation and disappears 10 (+/-2) seconds following patch development. [[@sirotkin2010quantitative]]]]
* - [[[[EVD]] - At zero seconds, 7000 actin proteins associated with endocytic invagination - [[@sirotkin2010quantitative]]]]
* - actin assembly peaks (x) seconds before/after endocytic scission
* - [[[[CLM]] - Actin assembly peaks 8 seconds before endocytic scission]]
* - ## Notes
* - 
*/
type SerializedTreeNode = Omit<TreeNode, "children" | "editTime"> & {
children: SerializedTreeNode[];
editTime: string;
};
const deserializeTreeNode = (node: SerializedTreeNode): TreeNode => ({
...node,
editTime: new Date(node.editTime),
children: node.children.map(deserializeTreeNode),
});
const title =
"[[CLM]] - Actin assembly peaks 8 seconds before endocytic scission";
const serializedBlocks: SerializedTreeNode[] = [
{
text: "Source of Claim [ℹ](((JtVWq1Cwl)))",
open: true,
order: 0,
uid: "yxM5yI07g",
heading: 2,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:28:17.505Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [
{
text: "[[[[EVD]] - Membrane invagination occurred ~6 seconds after scission protein (spHob1-GFP) was detected in budding yeast cells - [[@sun2019direct]]]]",
open: true,
order: 0,
uid: "tZnNCIgsk",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-03-25T05:40:43.601Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [],
parents: [0],
},
{
text: "[[[[EVD]] - At fission yeast endocytic sites, scission protein (spHob1) first detected ~2 seconds before initiation of membrane invagination - [[@sun2019direct]]]]",
open: true,
order: 1,
uid: "i-rS06THC",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:38:44.920Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [],
parents: [0],
},
{
text: "[[[[EVD]] - Actin appearance occurred 9 (+/-2) seconds prior to patch formation and disappears 10 (+/-2) seconds following patch development. [[@sirotkin2010quantitative]]]]",
open: true,
order: 2,
uid: "fiWpNvVM8",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:38:54.473Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [],
parents: [0],
},
{
text: "[[[[EVD]] - At zero seconds, 7000 actin proteins associated with endocytic invagination - [[@sirotkin2010quantitative]]]]",
open: true,
order: 3,
uid: "nz8-Sd5a5",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:39:03.540Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [],
parents: [0],
},
{
text: "",
open: true,
order: 4,
uid: "fEcOIBDD7",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:39:31.790Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [],
parents: [0],
},
{
text: "actin assembly peaks (x) seconds before/after endocytic scission",
open: true,
order: 5,
uid: "xgfRsZ-Xb",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:38:25.591Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [
{
text: "[[[[CLM]] - Actin assembly peaks 8 seconds before endocytic scission]]",
open: true,
order: 0,
uid: "URYHjVOwB",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:48:24.324Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [],
parents: [0],
},
],
parents: [0],
},
],
parents: [],
},
{
text: "Notes",
open: true,
order: 1,
uid: "LVRwULrGC",
heading: 2,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-02-29T21:28:17.509Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [
{
text: "",
open: true,
order: 0,
uid: "aMAPTRui2",
heading: 0,
viewType: "bullet",
blockViewType: "outline",
editTime: "2024-03-07T22:57:13.411Z",
props: {
imageResize: {},
iframe: {},
},
textAlign: "left",
children: [],
parents: [0],
},
],
parents: [],
},
];
const blocks = serializedBlocks.map(deserializeTreeNode);
export const roamClaimFullMarkdownExample: {
title: string;
blocks: TreeNode[];
full: CrossAppNode["content"]["full"];
} = {
title,
blocks,
full: {
format: "text/markdown",
value: buildFullMarkdown({ title, blocks }),
},
};