@tolokoban/impress 0.3.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/styles.js CHANGED
@@ -64,13 +64,20 @@ export const defaultTheme = {
64
64
  },
65
65
  /** Geometry in cm (16:9 slide). */
66
66
  slide: { width: 28, height: 15.75 },
67
- content: { x: 1.2, y: 3.0, width: 25.6, height: 11.9, gap: 0.3 },
67
+ content: { x: 1.2, y: 3.0, width: 25.6, height: 11.9, gap: 0.3, align: "top" },
68
68
  /** `@graph` diagrams. */
69
69
  graph: {
70
- /** Connector kind for edges: "curve", "line", "standard" (elbows) or "lines". */
71
- connector: "curve",
72
70
  /** Maximum enlargement of a diagram relative to its Graphviz size. */
73
71
  maxScale: 1.5,
72
+ /** Resolution of the PNG rendered by Graphviz, in dots per inch. */
73
+ dpi: 300,
74
+ },
75
+ /** Every embedded image (graphs included) is stored as WebP. */
76
+ images: {
77
+ /** WebP quality, from 0 to 100. */
78
+ quality: 70,
79
+ /** Longest side in pixels: larger images are shrunk. */
80
+ maxSize: 3840,
74
81
  },
75
82
  /** Images of the master pages, styled by `Master-image` and `Section-image`. */
76
83
  backgrounds: {
@@ -93,6 +100,15 @@ const bullets = {
93
100
  indent: 0.9,
94
101
  size: "80%",
95
102
  };
103
+ const numbers = {
104
+ formats: ["1", "a", "i", "1", "a", "i", "1", "a", "i"],
105
+ suffix: ".",
106
+ color: "{colors.accent}",
107
+ size: "100%",
108
+ weight: "bold",
109
+ indent: 0.9,
110
+ width: 0.9,
111
+ };
96
112
  function masterStyles(master) {
97
113
  const isSection = master === "Section";
98
114
  const styles = {
@@ -119,6 +135,7 @@ function masterStyles(master) {
119
135
  paragraph: { "fo:margin-top": "0.1cm", "fo:margin-bottom": "0.15cm", "fo:line-height": "105%" },
120
136
  text: { ...sans, "fo:font-size": "{sizes.list.0}pt", "fo:color": "{colors.ink}" },
121
137
  bullets,
138
+ numbers,
122
139
  },
123
140
  };
124
141
  for (let level = 2; level <= 9; level++) {
@@ -232,6 +249,12 @@ const defaultStyles = {
232
249
  "draw:stroke": "solid",
233
250
  "svg:stroke-color": "{colors.primary}",
234
251
  "svg:stroke-width": "0.03cm",
252
+ "draw:shadow": "visible",
253
+ "draw:shadow-offset-x": "0.1cm",
254
+ "draw:shadow-offset-y": "0.1cm",
255
+ "draw:shadow-color": "{colors.muted}",
256
+ "draw:shadow-opacity": "30%",
257
+ "loext:shadow-blur": "0.3cm",
235
258
  "fo:padding-left": "0.6cm",
236
259
  "fo:padding-right": "0.6cm",
237
260
  "fo:padding-top": "0.4cm",
@@ -290,6 +313,7 @@ const defaultStyles = {
290
313
  paragraph: { "fo:margin-bottom": "0.15cm" },
291
314
  text: { "fo:font-size": "{sizes.columnText}pt" },
292
315
  bullets,
316
+ numbers,
293
317
  },
294
318
  /** `@layout grid ...`: cell headings and cell bodies, colored by position. */
295
319
  "Grille-titre": {
@@ -314,6 +338,7 @@ const defaultStyles = {
314
338
  paragraph: { "fo:margin-bottom": "0.12cm" },
315
339
  text: { "fo:font-size": "{sizes.gridText}pt" },
316
340
  bullets,
341
+ numbers,
317
342
  },
318
343
  ...gridStyles(),
319
344
  /** Master page decorations. */
@@ -327,73 +352,6 @@ const defaultStyles = {
327
352
  parent: "standard",
328
353
  graphic: { "draw:fill": "solid", "draw:fill-color": "{colors.accent}", "draw:stroke": "none" },
329
354
  },
330
- /** `@graph` diagrams: nodes, clusters and edges. */
331
- "Graphe-noeud": {
332
- family: "graphic",
333
- parent: "standard",
334
- graphic: {
335
- ...shrink,
336
- "draw:fill": "solid",
337
- "draw:fill-color": "{colors.graphNode}",
338
- "draw:stroke": "solid",
339
- "svg:stroke-color": "{colors.primary}",
340
- "svg:stroke-width": "0.03cm",
341
- "draw:textarea-vertical-align": "middle",
342
- "draw:textarea-horizontal-align": "center",
343
- "fo:padding-left": "0.05cm",
344
- "fo:padding-right": "0.05cm",
345
- "fo:padding-top": "0.05cm",
346
- "fo:padding-bottom": "0.05cm",
347
- },
348
- paragraph: { "fo:text-align": "center" },
349
- text: { "fo:font-size": "{sizes.graphText}pt", "fo:color": "{colors.ink}" },
350
- },
351
- /** Nodes with `shape=plaintext` (or none). */
352
- "Graphe-texte": {
353
- family: "graphic",
354
- parent: "Graphe-noeud",
355
- graphic: { "draw:fill": "none", "draw:stroke": "none" },
356
- },
357
- /** Graph label (`graph [label=...]`). */
358
- "Graphe-titre": {
359
- family: "graphic",
360
- parent: "Graphe-texte",
361
- text: { "fo:font-weight": "bold", "fo:color": "{colors.primary}" },
362
- },
363
- "Graphe-groupe": {
364
- family: "graphic",
365
- parent: "standard",
366
- graphic: {
367
- "draw:fill": "solid",
368
- "draw:fill-color": "{colors.graphCluster}",
369
- "draw:stroke": "solid",
370
- "svg:stroke-color": "{colors.muted}",
371
- "svg:stroke-width": "0.02cm",
372
- "draw:textarea-vertical-align": "top",
373
- "draw:textarea-horizontal-align": "center",
374
- "draw:auto-grow-height": "false",
375
- },
376
- paragraph: { "fo:text-align": "center" },
377
- text: { "fo:font-size": "{sizes.graphEdgeText}pt", "fo:font-weight": "bold", "fo:color": "{colors.muted}" },
378
- },
379
- /** Edges without arrow (undirected graphs, `dir=none`). */
380
- "Graphe-lien-simple": {
381
- family: "graphic",
382
- parent: "standard",
383
- graphic: { "draw:stroke": "solid", "svg:stroke-color": "{colors.ink}", "svg:stroke-width": "0.03cm" },
384
- text: { "fo:font-size": "{sizes.graphEdgeText}pt", "fo:color": "{colors.ink}" },
385
- },
386
- "Graphe-lien": {
387
- family: "graphic",
388
- parent: "Graphe-lien-simple",
389
- graphic: { "draw:marker-end": "Fleche", "draw:marker-end-width": "0.3cm" },
390
- },
391
- /** Edges with `dir=both`. */
392
- "Graphe-lien-double": {
393
- family: "graphic",
394
- parent: "Graphe-lien",
395
- graphic: { "draw:marker-start": "Fleche", "draw:marker-start-width": "0.3cm" },
396
- },
397
355
  "Decor-ligne": {
398
356
  family: "graphic",
399
357
  parent: "standard",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolokoban/impress",
3
- "version": "0.3.0",
3
+ "version": "0.13.0",
4
4
  "description": "Convert teaching markdown files into LibreOffice Impress presentations (.odp)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,11 +41,11 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "dependencies": {
45
- "@hpcc-js/wasm-graphviz": "1.30.0"
46
- },
47
44
  "devDependencies": {
48
45
  "@types/node": "^24.19.2",
49
46
  "typescript": "^7.0.2"
47
+ },
48
+ "dependencies": {
49
+ "sharp": "0.35.5"
50
50
  }
51
51
  }