I keep my resume on github, and is going to update it with my working experience changing.Since resume is written in markdown format on github, I need a PDF format when applying job on line. How to convert markdown file to PDF file easily?
Convert markdown file to html format first
You need to check markdown is already installed or not. If not, you need use apt install markdown
to install it.
1 | anna@ubuntu1804:~$ which markdown |
Go to directory where your markdown file lies, run
1 | anna@ubuntu1804:~/git_repo/resume$ markdown resume.md resume.html |
you will convert resume.md markdown file to resume.html
then you can go to webbrowser to see this html file, to make sure it works.
Convert html file to PDF file
To convert PDF file, you need to use wkhtmltopdf tool
1 | apt install wkhtmltopdf |
go to the same directory where the resume.md and resume.html lie, run
1 | wkhtmltopdf -s letter -B 25mm -T 25mm -L 25mm -R 25mm resume.html resume.pdf |
then you can get the PDF format resume file.
1 | anna@ubuntu1804:~/git_repo/resume$ ll |
Write a script to execute convert automaticly
1 | #/bin/bash |
after you update resume, you can run md2pdf.sh, then get the PDF file automaticlly
1 | anna@ubuntu1804:~/git_repo/resume$ ./md2pdf.sh resume.md |