-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhello-world.jdf
More file actions
354 lines (354 loc) · 8.42 KB
/
Copy pathhello-world.jdf
File metadata and controls
354 lines (354 loc) · 8.42 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
{
"$jdf": "1.0.0",
"footer": {
"content": "{{title}} · page {{pageNumber}} of {{totalPages}}",
"style": "muted"
},
"meta": {
"author": "Ugur Kazdal",
"language": "en",
"margins": {
"bottom": 25,
"left": 22,
"right": 22,
"top": 25
},
"pageSize": "A4",
"title": "Hello, JDF",
"unit": "mm"
},
"pages": [
{
"elements": [
{
"content": "DOCUMENT FORMAT",
"position": {
"x": 0,
"y": 0
},
"style": "label",
"type": "text",
"width": 166
},
{
"content": "Hello, JDF",
"heading": 1,
"position": {
"x": 0,
"y": 8
},
"style": "h1",
"tocEntry": "Hello, JDF",
"tocLevel": 1,
"type": "text",
"width": 166
},
{
"content": "A document format that's just JSON. Renders like PDF. Diffs in git. Edits in any text editor. This file you're reading is a real .jdf — view source to see the JSON.",
"position": {
"x": 0,
"y": 30
},
"style": "lead",
"type": "text",
"width": 166
},
{
"fill": "#2563eb",
"height": 0.6,
"position": {
"x": 0,
"y": 56
},
"shape": "rect",
"type": "shape",
"width": 18
},
{
"content": "What it does",
"heading": 2,
"position": {
"x": 0,
"y": 64
},
"style": "h2",
"tocEntry": "What it does",
"tocLevel": 2,
"type": "text",
"width": 166
},
{
"content": "Open .jdf in any text editor and you see clean JSON. Open it in JDF Reader and you see a beautifully rendered page. Edit either side, the other reflects it.",
"position": {
"x": 0,
"y": 76
},
"style": "body",
"type": "text",
"width": 166
},
{
"items": [
{
"content": "Human-readable JSON — open with cat, grep, jq, VS Code."
},
{
"content": "git diff is real — change a heading, see one line change."
},
{
"content": "Generate from code — JSON.stringify(doc) is your PDF library."
},
{
"content": "JSON Schema validation — autocomplete in your editor, errors in CI."
},
{
"content": "AI-friendly — LLMs read JSON natively, no parser, no broken tables."
}
],
"listType": "unordered",
"position": {
"x": 0,
"y": 100
},
"style": "body",
"type": "list",
"width": 166
},
{
"content": "Three surfaces",
"heading": 2,
"position": {
"x": 0,
"y": 152
},
"style": "h2",
"tocEntry": "Three surfaces",
"tocLevel": 2,
"type": "text",
"width": 166
},
{
"alternatingRowColor": "#f8fafc",
"borders": {
"color": "#e2e8f0",
"inner": true,
"outer": true,
"width": 0.3
},
"headerStyle": {
"backgroundColor": "#f1f5f9",
"color": "#0f172a",
"fontSize": 10,
"fontWeight": "bold"
},
"headers": [
"Surface",
"What",
"Install"
],
"columns": [
{ "width": 40 },
{ "width": 76 },
{ "width": 50 }
],
"position": {
"x": 0,
"y": 164
},
"rowStyle": {
"color": "#334155",
"fontSize": 10
},
"rows": [
[
"JDF Reader",
"Native macOS desktop app",
"brew install jdf"
],
[
"jdf.js",
"JavaScript embed library",
"npm install @uurtech/jdf"
],
[
"@uurtech/jdf-cli",
"CLI for validate / convert",
"npx @uurtech/jdf-cli validate"
]
],
"type": "table",
"width": 166
},
{
"align": "right",
"content": "Continued on the next page →",
"position": {
"x": 0,
"y": 235
},
"style": "muted",
"type": "text",
"width": 166
}
],
"id": "page-1"
},
{
"elements": [
{
"content": "DOCUMENT FORMAT",
"position": {
"x": 0,
"y": 0
},
"style": "label",
"type": "text",
"width": 166
},
{
"content": "Table of Contents",
"heading": 1,
"position": {
"x": 0,
"y": 8
},
"style": "h1",
"type": "text",
"width": 166
},
{
"fill": "#2563eb",
"height": 0.6,
"position": {
"x": 0,
"y": 32
},
"shape": "rect",
"type": "shape",
"width": 18
},
{
"depth": 3,
"position": {
"x": 0,
"y": 42
},
"style": "body",
"type": "toc",
"width": 166
},
{
"content": "Embedding on the web",
"heading": 2,
"position": {
"x": 0,
"y": 110
},
"style": "h2",
"tocEntry": "Embedding",
"tocLevel": 2,
"type": "text",
"width": 166
},
{
"content": "Three lines of HTML and your document appears, fully styled, on any web page:",
"position": {
"x": 0,
"y": 122
},
"style": "body",
"type": "text",
"width": 166
},
{
"content": "<link rel=\"stylesheet\" href=\"https://unpkg.com/@uurtech/jdf/dist/jdfjs.css\">\n<script type=\"module\" src=\"https://unpkg.com/@uurtech/jdf\"></script>\n<jdf src=\"/whitepaper.jdf\"></jdf>",
"position": {
"x": 0,
"y": 138
},
"style": {
"backgroundColor": "#f1f5f9",
"borderRadius": 4,
"color": "#1e293b",
"fontFamily": "JetBrains Mono",
"fontSize": 9,
"lineHeight": 1.5,
"padding": 10
},
"type": "text",
"width": 166
},
{
"content": "Try it yourself",
"heading": 2,
"position": {
"x": 0,
"y": 178
},
"style": "h2",
"tocEntry": "Try it",
"tocLevel": 2,
"type": "text",
"width": 166
},
{
"elements": [
{
"content": "Today: nothing meaningful. Tomorrow: anything we want to add. The format is open, the schema is JSON, the renderers are MIT.",
"style": "body",
"type": "text"
}
],
"expanded": false,
"position": {
"x": 0,
"y": 190
},
"title": "What does PDF do that JDF can't?",
"type": "collapsible",
"width": 166
}
],
"id": "page-2"
}
],
"styles": {
"body": {
"color": "#334155",
"fontFamily": "Inter",
"fontSize": 11,
"lineHeight": 1.65
},
"h1": {
"color": "#0f172a",
"fontFamily": "Inter",
"fontSize": 32,
"fontWeight": "bold",
"lineHeight": 1.1
},
"h2": {
"color": "#1e293b",
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "bold",
"lineHeight": 1.3
},
"label": {
"color": "#94a3b8",
"fontFamily": "Inter",
"fontSize": 9,
"fontWeight": "bold"
},
"lead": {
"color": "#475569",
"fontFamily": "Inter",
"fontSize": 13,
"lineHeight": 1.55
},
"muted": {
"color": "#94a3b8",
"fontFamily": "Inter",
"fontSize": 9
}
}
}