@promovaweb/ebookfy 0.5.1 → 0.6.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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@promovaweb/ebookfy",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Organize capítulos e exporte seu ebook em PDF, EPUB e MOBI.",
5
5
  "type": "module",
6
6
  "private": false,
7
- "license": "UNLICENSED",
7
+ "license": "AGPL-3.0-only",
8
8
  "bin": {
9
9
  "ebookfy": "bin/ebookfy.cjs"
10
10
  },
@@ -23,7 +23,8 @@
23
23
  "test": "node --test tests/*.test.mjs",
24
24
  "manual": "cd manual && bun ../src/main.ts build",
25
25
  "build": "bun build ./src/main.ts --target=bun --packages=external --outdir dist/bin",
26
- "prepack": "npm run build"
26
+ "prepack": "npm run build",
27
+ "capturas": "node scripts/capturas.mjs"
27
28
  },
28
29
  "engines": {
29
30
  "node": ">=22"
@@ -39,6 +40,8 @@
39
40
  },
40
41
  "devDependencies": {
41
42
  "@types/bun": "^1.4.4",
43
+ "@xterm/xterm": "6.0.0",
44
+ "playwright-core": "1.63.0",
42
45
  "typescript": "^7.0.2"
43
46
  },
44
47
  "author": "Promovaweb",
@@ -47,7 +50,8 @@
47
50
  "print",
48
51
  "brand/logo",
49
52
  "README.md",
50
- "bin"
53
+ "bin",
54
+ "LICENSE"
51
55
  ],
52
56
  "publishConfig": {
53
57
  "access": "public"
@@ -0,0 +1,13 @@
1
+ -- Notas de rodapé no pé da página do PDF.
2
+ --
3
+ -- O Pandoc reúne as notas do HTML numa seção no fim do documento. O PDF sai
4
+ -- do WeasyPrint, que posiciona no pé da página qualquer elemento com
5
+ -- `float: footnote`. Este filtro troca cada nota por um span com a classe
6
+ -- `footnote`, no lugar da chamada; o pdf.css faz o resto (chamada, marcador
7
+ -- e área da nota). Só a conversão para o PDF usa o filtro: o EPUB mantém as
8
+ -- notas com link de ida e volta.
9
+
10
+ function Note(nota)
11
+ local inlines = pandoc.utils.blocks_to_inlines(nota.content, { pandoc.Space() })
12
+ return pandoc.Span(inlines, { class = "footnote" })
13
+ end
package/print/pdf.css CHANGED
@@ -329,3 +329,35 @@ hr {
329
329
  border: 0;
330
330
  border-top: 1px solid var(--pdf-border);
331
331
  }
332
+
333
+ /* Notas de rodapé no pé da página: o filtro notas.lua troca cada nota por
334
+ span.footnote no lugar da chamada; o WeasyPrint numera e posiciona. */
335
+ span.footnote {
336
+ float: footnote;
337
+ font-size: 8.5pt;
338
+ line-height: 1.4;
339
+ color: var(--pdf-graphite);
340
+ font-style: normal;
341
+ font-weight: normal;
342
+ }
343
+
344
+ ::footnote-call {
345
+ content: counter(footnote);
346
+ vertical-align: super;
347
+ font-size: 70%;
348
+ line-height: 0;
349
+ color: var(--pdf-link);
350
+ }
351
+
352
+ ::footnote-marker {
353
+ content: counter(footnote) ". ";
354
+ color: var(--pdf-link);
355
+ }
356
+
357
+ @page {
358
+ @footnote {
359
+ margin-top: 10px;
360
+ padding-top: 6px;
361
+ border-top: 0.5pt solid var(--pdf-border);
362
+ }
363
+ }