Skip to content

Commit

Permalink
Merge pull request #10 from futabooo/modify-create-pdf-library
Browse files Browse the repository at this point in the history
pdf生成のライブラリを変更する
  • Loading branch information
futabooo authored Aug 10, 2024
2 parents ce2b520 + 771d308 commit 5fc7d79
Show file tree
Hide file tree
Showing 7 changed files with 2,118 additions and 1,364 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/create_pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ jobs:
name: Create PDF
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16.9.1"
- name: install japanese font
run: sudo apt install fonts-sawarabi-gothic
node-version: "22.6.0"
- run: |
npm install
node ./md2pdf.js
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
curriculum-vitae-jp.pdf
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.9.1
22.6.0
1 change: 1 addition & 0 deletions en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- 10X, Inc.
- Software Engineer
- 2020/07 - now
- `Flutter`, `Dart`, `GCP`,
- eureka, Inc.
- Software Engineer
- Pairs Engage Division 2019/05 - 2020/06
Expand Down
29 changes: 12 additions & 17 deletions md2pdf.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
var markdownpdf = require("markdown-pdf");
const fs = require("fs");
const { mdToPdf } = require("md-to-pdf");

var mdDocs = ["./jp/README.md", "./en/README.md"],
pdfDocs = mdDocs.map(function (d) {
if (d.includes("jp")) {
return "curriculum-vitae-jp.pdf";
} else {
return "curriculum-vitae-en.pdf";
}
});

markdownpdf({ cssPath: "./pdfstyle.css" })
.from(mdDocs)
.to(pdfDocs, function () {
pdfDocs.forEach(function (d) {
console.log("Created", d);
});
});
(async () => {
await mdToPdf(
{ path: "./jp/README.md" },
{ dest: "./curriculum-vitae-jp.pdf" }
);
await mdToPdf(
{ path: "./en/README.md" },
{ dest: "./curriculum-vitae-en.pdf" }
);
})();
Loading

0 comments on commit 5fc7d79

Please sign in to comment.