-
Chapitres
+
Livre & chapitres
diff --git a/package.json b/package.json
index 4a7445d..6a8388e 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
- "postinstall": "nuxt prepare"
+ "postinstall": "nuxt prepare && sh scripts/copy-pdfjs.sh"
},
"dependencies": {
"@nuxt/content": "^3.11.2",
@@ -17,6 +17,7 @@
"@vueuse/nuxt": "^14.2.1",
"better-sqlite3": "^12.6.2",
"nuxt": "^4.3.1",
+ "pdfjs-dist": "^5.4.624",
"vue": "^3.5.28",
"vue-router": "^4.6.4",
"yaml": "^2.8.2"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e123a0d..28efa5c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -29,6 +29,9 @@ importers:
nuxt:
specifier: ^4.3.1
version: 4.3.1(@parcel/watcher@2.5.6)(@types/node@25.2.3)(@vue/compiler-sfc@3.5.28)(better-sqlite3@12.6.2)(cac@6.7.14)(db0@0.3.4(better-sqlite3@12.6.2))(ioredis@5.9.3)(magicast@0.5.2)(rollup@4.57.1)(terser@5.46.0)(typescript@5.9.3)(vite@7.3.1(@types/node@25.2.3)(jiti@2.6.1)(terser@5.46.0)(yaml@2.8.2))(yaml@2.8.2)
+ pdfjs-dist:
+ specifier: ^5.4.624
+ version: 5.4.624
vue:
specifier: ^3.5.28
version: 3.5.28(typescript@5.9.3)
@@ -598,6 +601,81 @@ packages:
engines: {node: '>=18'}
hasBin: true
+ '@napi-rs/canvas-android-arm64@0.1.95':
+ resolution: {integrity: sha512-SqTh0wsYbetckMXEvHqmR7HKRJujVf1sYv1xdlhkifg6TlCSysz1opa49LlS3+xWuazcQcfRfmhA07HxxxGsAA==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [android]
+
+ '@napi-rs/canvas-darwin-arm64@0.1.95':
+ resolution: {integrity: sha512-F7jT0Syu+B9DGBUBcMk3qCRIxAWiDXmvEjamwbYfbZl7asI1pmXZUnCOoIu49Wt0RNooToYfRDxU9omD6t5Xuw==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@napi-rs/canvas-darwin-x64@0.1.95':
+ resolution: {integrity: sha512-54eb2Ho15RDjYGXO/harjRznBrAvu+j5nQ85Z4Qd6Qg3slR8/Ja+Yvvy9G4yo7rdX6NR9GPkZeSTf2UcKXwaXw==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@napi-rs/canvas-linux-arm-gnueabihf@0.1.95':
+ resolution: {integrity: sha512-hYaLCSLx5bmbnclzQc3ado3PgZ66blJWzjXp0wJmdwpr/kH+Mwhj6vuytJIomgksyJoCdIqIa4N6aiqBGJtJ5Q==}
+ engines: {node: '>= 10'}
+ cpu: [arm]
+ os: [linux]
+
+ '@napi-rs/canvas-linux-arm64-gnu@0.1.95':
+ resolution: {integrity: sha512-J7VipONahKsmScPZsipHVQBqpbZx4favaD8/enWzzlGcjiwycOoymL7f4tNeqdjK0su19bDOUt6mjp9gsPWYlw==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/canvas-linux-arm64-musl@0.1.95':
+ resolution: {integrity: sha512-PXy0UT1J/8MPG8UAkWp6Fd51ZtIZINFzIjGH909JjQrtCuJf3X6nanHYdz1A+Wq9o4aoPAw1YEUpFS1lelsVlg==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ '@napi-rs/canvas-linux-riscv64-gnu@0.1.95':
+ resolution: {integrity: sha512-2IzCkW2RHRdcgF9W5/plHvYFpc6uikyjMb5SxjqmNxfyDFz9/HB89yhi8YQo0SNqrGRI7yBVDec7Pt+uMyRWsg==}
+ engines: {node: '>= 10'}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/canvas-linux-x64-gnu@0.1.95':
+ resolution: {integrity: sha512-OV/ol/OtcUr4qDhQg8G7SdViZX8XyQeKpPsVv/j3+7U178FGoU4M+yIocdVo1ih/A8GQ63+LjF4jDoEjaVU8Pw==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/canvas-linux-x64-musl@0.1.95':
+ resolution: {integrity: sha512-Z5KzqBK/XzPz5+SFHKz7yKqClEQ8pOiEDdgk5SlphBLVNb8JFIJkxhtJKSvnJyHh2rjVgiFmvtJzMF0gNwwKyQ==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ '@napi-rs/canvas-win32-arm64-msvc@0.1.95':
+ resolution: {integrity: sha512-aj0YbRpe8qVJ4OzMsK7NfNQePgcf9zkGFzNZ9mSuaxXzhpLHmlF2GivNdCdNOg8WzA/NxV6IU4c5XkXadUMLeA==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@napi-rs/canvas-win32-x64-msvc@0.1.95':
+ resolution: {integrity: sha512-GA8leTTCfdjuHi8reICTIxU0081PhXvl3lzIniLUjeLACx9GubUiyzkwFb+oyeKLS5IAGZFLKnzAf4wm2epRlA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [win32]
+
+ '@napi-rs/canvas@0.1.95':
+ resolution: {integrity: sha512-lkg23ge+rgyhgUwXmlbkPEhuhHq/hUi/gXKH+4I7vO+lJrbNfEYcQdJLIGjKyXLQzgFiiyDAwh5vAe/tITAE+w==}
+ engines: {node: '>= 10'}
+
'@napi-rs/wasm-runtime@1.1.1':
resolution: {integrity: sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==}
@@ -3336,6 +3414,9 @@ packages:
node-mock-http@1.0.4:
resolution: {integrity: sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ==}
+ node-readable-to-web-readable-stream@0.4.2:
+ resolution: {integrity: sha512-/cMZNI34v//jUTrI+UIo4ieHAB5EZRY/+7OmXZgBxaWBMcW2tGdceIw06RFxWxrKZ5Jp3sI2i5TsRo+CBhtVLQ==}
+
node-releases@2.0.27:
resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==}
@@ -3496,6 +3577,10 @@ packages:
pathe@2.0.3:
resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}
+ pdfjs-dist@5.4.624:
+ resolution: {integrity: sha512-sm6TxKTtWv1Oh6n3C6J6a8odejb5uO4A4zo/2dgkHuC0iu8ZMAXOezEODkVaoVp8nX1Xzr+0WxFJJmUr45hQzg==}
+ engines: {node: '>=20.16.0 || >=22.3.0'}
+
perfect-debounce@1.0.0:
resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}
@@ -5214,6 +5299,54 @@ snapshots:
- encoding
- supports-color
+ '@napi-rs/canvas-android-arm64@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-darwin-arm64@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-darwin-x64@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-linux-arm-gnueabihf@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-linux-arm64-gnu@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-linux-arm64-musl@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-linux-riscv64-gnu@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-linux-x64-gnu@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-linux-x64-musl@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-win32-arm64-msvc@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas-win32-x64-msvc@0.1.95':
+ optional: true
+
+ '@napi-rs/canvas@0.1.95':
+ optionalDependencies:
+ '@napi-rs/canvas-android-arm64': 0.1.95
+ '@napi-rs/canvas-darwin-arm64': 0.1.95
+ '@napi-rs/canvas-darwin-x64': 0.1.95
+ '@napi-rs/canvas-linux-arm-gnueabihf': 0.1.95
+ '@napi-rs/canvas-linux-arm64-gnu': 0.1.95
+ '@napi-rs/canvas-linux-arm64-musl': 0.1.95
+ '@napi-rs/canvas-linux-riscv64-gnu': 0.1.95
+ '@napi-rs/canvas-linux-x64-gnu': 0.1.95
+ '@napi-rs/canvas-linux-x64-musl': 0.1.95
+ '@napi-rs/canvas-win32-arm64-msvc': 0.1.95
+ '@napi-rs/canvas-win32-x64-msvc': 0.1.95
+ optional: true
+
'@napi-rs/wasm-runtime@1.1.1':
dependencies:
'@emnapi/core': 1.8.1
@@ -8512,6 +8645,9 @@ snapshots:
node-mock-http@1.0.4: {}
+ node-readable-to-web-readable-stream@0.4.2:
+ optional: true
+
node-releases@2.0.27: {}
nopt@8.1.0:
@@ -8855,6 +8991,11 @@ snapshots:
pathe@2.0.3: {}
+ pdfjs-dist@5.4.624:
+ optionalDependencies:
+ '@napi-rs/canvas': 0.1.95
+ node-readable-to-web-readable-stream: 0.4.2
+
perfect-debounce@1.0.0: {}
perfect-debounce@2.1.0: {}
diff --git a/public/pdfjs/viewer.html b/public/pdfjs/viewer.html
new file mode 100644
index 0000000..38a238a
--- /dev/null
+++ b/public/pdfjs/viewer.html
@@ -0,0 +1,546 @@
+
+
+
+
+
+
PDF Viewer
+
+
+
+
+
+
+
+
+
+
+
Chargement du PDF…
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scripts/copy-pdfjs.sh b/scripts/copy-pdfjs.sh
new file mode 100755
index 0000000..2d91d0c
--- /dev/null
+++ b/scripts/copy-pdfjs.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Copie les fichiers PDF.js nécessaires depuis node_modules vers public/pdfjs/
+set -e
+
+DEST="public/pdfjs"
+SRC="node_modules/pdfjs-dist/build"
+
+mkdir -p "$DEST"
+cp "$SRC/pdf.min.mjs" "$DEST/pdf.min.mjs"
+cp "$SRC/pdf.worker.min.mjs" "$DEST/pdf.worker.min.mjs"
+
+echo "[copy-pdfjs] OK"