Skip to content

Commit

Permalink
Merge pull request #41 from zhumeisongsong/feature/add-pdf-config
Browse files Browse the repository at this point in the history
feat: ✨ add md-to-pdf
  • Loading branch information
zhumeisongsong authored Oct 30, 2024
2 parents 3608105 + c89c53c commit 242478a
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules

.DS_Store
src/.vitepress/cache
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"license": "MIT",
"scripts": {
"commit": "git-cz",
"lint": "textlint docs/README.md",
"build:pdf": "md-to-pdf docs/README.md --config-file ./pdf-configs/config.js",
"lint": "textlint src/*.md",
"build:pdf": "md-to-pdf src/*.md --config-file pdf-config.js",
"docs:dev": "vitepress dev src",
"docs:build": "vitepress build src",
"docs:preview": "vitepress preview src"
Expand All @@ -14,6 +14,7 @@
"devDependencies": {
"@zhumeisong/git-cz-config": "^1.1.1",
"git-cz": "4.9.0",
"md-to-pdf": "^5.2.4",
"semantic-release": "24.1.2",
"textlint": "14.0.4",
"textlint-rule-spellcheck-tech-word": "5.0.0",
Expand All @@ -34,9 +35,6 @@
"node": "20.18.0",
"pnpm": "9.12.3"
},
"dependencies": {
"md-to-pdf": "^5.2.4"
},
"config": {
"commitizen": {
"path": "git-cz"
Expand Down
15 changes: 15 additions & 0 deletions pdf-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
body_class: "markdown-body",
marked_options: {
headerIds: false,
smartypants: true,
},
pdf_options: {
"format": "A4",
"margin": "30mm 20mm",
"printBackground": true,
"headerTemplate": "<style>\n section {\n margin: 0 auto;\n font-size: 9px;\n }\n</style>",
"footerTemplate": "<section>\n <div>\n <span class=\"pageNumber\"></span>\n / <span class=\"totalPages\"></span>\n </div>\n</section>"
},
stylesheet_encoding: "utf-8",
};
7 changes: 3 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineConfig({
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/zhumeisongsong' }
{ icon: 'github', link: 'https://github.com/zhumeisongsong/cv' }
]
}
})
7 changes: 7 additions & 0 deletions src/cv.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: doc
---


# 職務経歴書
Binary file added src/cv.ja.pdf
Binary file not shown.
File renamed without changes.
Binary file added src/cv.pdf
Binary file not shown.

0 comments on commit 242478a

Please sign in to comment.