-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20a7c93
commit 9b05cb6
Showing
2 changed files
with
965 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Convert Markdown with Mermaid to PDF | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/*.md' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
convert_md_to_pdf: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install pandoc and mermaid-filter | ||
run: | | ||
sudo apt-get install -y pandoc texlive-xetex | ||
npm install -g @mermaid-js/mermaid-cli | ||
pip install pandoc-mermaid-filter | ||
- name: Convert Markdown to PDF | ||
run: | | ||
for file in $(find . -name '*.md'); do | ||
pdf_file="${file%.md}.pdf" | ||
pandoc --filter=pandoc-mermaid-filter "$file" -o "$pdf_file" --pdf-engine=xelatex | ||
done | ||
- name: Upload PDFs as artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: converted-pdfs | ||
path: '**/*.pdf' |
Oops, something went wrong.