Skip to content

Commit c70ce2a

Browse files
committed
Simple cover for generated pdf
1 parent 5aa7658 commit c70ce2a

File tree

4 files changed

+84
-69
lines changed

4 files changed

+84
-69
lines changed

make-pdf.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
today=$(date +"%Y-%m-%d")
77

88
npx docu-pdf https://docs.bloomlibrary.org \
9-
--coverTitle "Bloom Docs" \
10-
--coverSub "Created from docs.bloomlibrary.org on ${today}" \
9+
--coverPath "./pdf-cover.htm" \
1110
--pageSize "A4" \
1211
--outputPath "static/downloads/docs-bloomlibrary-english-a4.pdf" \
12+
--tocLevel 1
1313

1414
# npx docu-pdf https://docs.bloomlibrary.org/fr \
1515
# --coverTitle "Docs Bloom" \

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"clsx": "^1.1.1",
3232
"cross-var": "^1.1.0",
3333
"docu-notion": "latest",
34-
"docu-pdf": "latest",
34+
"docu-pdf": "^1.2.1",
3535
"prism-react-renderer": "^1.3.1",
3636
"react": "^17.0.2",
3737
"react-dom": "^17.0.2",

pdf-cover.htm

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<div style="page-break-after:always">
2+
<div style="margin-top: 30%; text-align: center;font-family: sans-serif">
3+
<h1>docs.BloomLibrary.org</h1>
4+
<!-- <div>Snapshot from <span id="date"></span></div> -->
5+
</div>
6+
<!-- this works in a full html, but didn't work when run through docu-pdf
7+
<script>
8+
date = new Date();
9+
year = date.getFullYear();
10+
month = date.getMonth() + 1;
11+
day = date.getDate();
12+
document.getElementById("date").innerHTML = year + "-" + month + "-" + day;
13+
14+
</script> -->
15+
16+
</div>

0 commit comments

Comments
 (0)