Compare commits
3 Commits
6f41ae9730
...
99381bb361
| Author | SHA1 | Date | |
|---|---|---|---|
| 99381bb361 | |||
| d5c9dcf735 | |||
| bf60eeff7e |
@@ -9,8 +9,17 @@
|
||||
.mermaid {
|
||||
background-color: white;
|
||||
}
|
||||
p {
|
||||
margin-bottom: 0.0pt;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-bottom: 1pt;
|
||||
margin-top: 2pt;
|
||||
}
|
||||
div[data-cmd="sh"] {
|
||||
font-size: 8pt;
|
||||
}
|
||||
font-family: NanumGothic;
|
||||
|
||||
}
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,3 +4,5 @@
|
||||
*.out
|
||||
notes/*.o
|
||||
notes/*.s
|
||||
|
||||
node_modules/
|
||||
7
Makefile
7
Makefile
@@ -1,4 +1,9 @@
|
||||
all:
|
||||
all: clean build
|
||||
|
||||
clean:
|
||||
rm -f ./notes/*.out
|
||||
rm -f ./notes/*.o
|
||||
rm -f ./notes/*.s
|
||||
|
||||
build:
|
||||
node build.js
|
||||
43
build.js
Normal file
43
build.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const { Notebook } = require("crossnote")
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
async function main() {
|
||||
const notebook = await Notebook.init(
|
||||
{
|
||||
notebookPath: path.resolve(''),
|
||||
config: {
|
||||
previewTheme: 'github-light.css',
|
||||
mathRenderingOption: 'KaTeX',
|
||||
codeBlockTheme: 'github.css',
|
||||
printBackground: true,
|
||||
enableScriptExecution: true,
|
||||
|
||||
chromePath: '/usr/bin/google-chrome-stable',
|
||||
},
|
||||
}
|
||||
);
|
||||
const files = fs.readdirSync(path.resolve('notes')).filter(file => {
|
||||
return path.extname(file).toLowerCase() == '.md';
|
||||
});
|
||||
|
||||
files.forEach(async (file) => {
|
||||
const fileBase = "notes/" +path.basename(file);
|
||||
const fileName = path.basename(file, ".md")
|
||||
console.log("found " + fileBase);
|
||||
const engine = notebook.getNoteMarkdownEngine(fileBase);
|
||||
await engine.chromeExport({ runAllCodeChunks: true });
|
||||
|
||||
const old = path.resolve('notes', fileName + ".pdf");
|
||||
const dest = path.resolve('out', 'notes', fileName + ".pdf");
|
||||
|
||||
fs.rename(old, dest, (err) => {
|
||||
if (err) throw err;
|
||||
console.log(fileName + ".pdf" + " moved to out completed");
|
||||
});;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
main();
|
||||
BIN
out/notes/1.pdf
(Stored with Git LFS)
Normal file
BIN
out/notes/1.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
out/notes/2.pdf
(Stored with Git LFS)
Normal file
BIN
out/notes/2.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
out/notes/3.pdf
(Stored with Git LFS)
Normal file
BIN
out/notes/3.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
out/notes/4.pdf
(Stored with Git LFS)
Normal file
BIN
out/notes/4.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
6941
package-lock.json
generated
Normal file
6941
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
5
package.json
Normal file
5
package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"crossnote": "^0.9.15"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user