- Install Docker and start it.
- Transfer
mycv.mdtomycv.pdfwith one of the following command:
# without any stylesheet
docker run -i --rm --volume $(pwd):/work --workdir /work yeszao/topdf md2pdf mycv.md
# with topdf comes with stylesheet
docker run -i --rm --volume $(pwd):/work --workdir /work yeszao/topdf md2pdf mycv.md --theme=/css/cv.css
# with completely custom stylesheet
docker run -i --rm --volume $(pwd):/work --workdir /work yeszao/topdf md2pdf mycv.md --theme=style.cssWhere,
yeszao/topdfis the docker image name.md2pdfis the python pluginmd2pdfinstalled in the docker image, we can use it directly.--themeuse custom style sheet. You can:- let it blank,
- using
topdfcomes with style/css/cv.css, - or any other stylesheet placed in a current directory, here is
style.css.
- For convenience, we recommend naming alias for this command.
After naming alias, you can use it like this:
topdf mycv.md
topdf mycv.md --theme=/css/cv.cssopen ~/.bashrc or ~/.zshrc, add following line:
alias topdf='docker run -i --rm --volume $(pwd):/work --workdir /work yeszao/topdf md2pdf'- Create a file name
alias.batunder%USERPROFILE%folder, content:
@doskey topdf=docker run -i --rm --volume $(pwd):/work --workdir /work yeszao/topdf $*- Create another file name
alias.reg, content:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
"AutoRun"="%USERPROFILE%\\alias.bat"- Double click
alias.regfile, you can now use thetopdfcommand on the CMD:
Default, topdf image had included following fonts, you can just use it at your css file:
Arial(Bold, Italic, Bold Italic)Calibri(Bold, Italic, Bold Italic)Times New Roman(Bold, Italic, Bold Italic)Microsoft YaHei(微软雅黑)Hiragino Sans GB(冬青黑体)FZHei-B01S(方正黑体简体)
First, get an access token from hub.docker.com, then login with this access token:
docker login --username <username>Build the image and push it to hub.docker.com:
docker build -t yeszao/topdf -t yeszao/topdf:0.2 .
docker push yeszao/topdf --all-tags