Skip to content

Commit 4308320

Browse files
author
dphuang2
committed
markdown -> pdf resume
1 parent f1a7962 commit 4308320

File tree

6 files changed

+1346
-0
lines changed

6 files changed

+1346
-0
lines changed

.github/workflows/create-pdf.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Create PDF File
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
convert_via_pandoc:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Check out repository code
14+
uses: actions/checkout@v3 # this checks out the repo in the ubuntu container
15+
- name: "Create a folder called output"
16+
working-directory: markdown-resume
17+
run: |
18+
mkdir output
19+
cp resume-stylesheet.css output/resume-stylesheet.css
20+
cp resume.md output/${{ github.actor }}-resume.md
21+
# Downloading the binaries directly, because they are newer and work better, than the ones that come with Ubuntu latest.
22+
- name: "Install pandoc and wkhtmltopdf"
23+
working-directory: markdown-resume
24+
run: |
25+
wget https://github.com/jgm/pandoc/releases/download/3.0.1/pandoc-3.0.1-1-amd64.deb
26+
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
27+
sudo apt install ./pandoc-3.0.1-1-amd64.deb
28+
sudo apt install ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb
29+
30+
- name: "Convert MD to HTML"
31+
working-directory: markdown-resume
32+
run: |
33+
pandoc resume.md -f markdown -t html -c resume-stylesheet.css -s -o output/${{github.actor}}-resume.html
34+
35+
- name: "Convert HTML to PDF "
36+
working-directory: markdown-resume
37+
run: "wkhtmltopdf --enable-local-file-access output/${{github.actor}}-resume.html output/${{github.actor}}-resume.pdf"
38+
# run: |
39+
# /usr/bin/pandoc -standalone --output=output/resume.pdf --css=resume-stylesheet.css --from=markdown --to=pdf --pdf-engine=/usr/bin/wkhtmltopdf resume.md
40+
- uses: actions/upload-artifact@master
41+
with: # basically this will put resume.md, resume.html, resume.pdf and resume-stylesheet.css in a zip file.
42+
name: ${{ github.actor }}'s Resume
43+
path: markdown-resume/output

markdown-resume/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
resume.pdf
2+
resume.html

markdown-resume/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Markdown Resume
2+
3+
This repo allows you to build/maintain your resume in a Markdown file, and then publish it into an HTML or PDF file.
4+
Technically, you could output it into any file you wanted with pandoc, or wkhtmltopdf, but I wasn't interested in those scenarios so I explore those avenues.
5+
6+
The inspiration for this project came from my need to look for a job, my need to update my resume, and my desire not to have to write something in Google docs, or Microsoft Word, so I scoured the web for newer way to build/maintain a resume, while doing so I ran into this [project by Sonya Sawtelle](https://sdsawtelle.github.io/blog/output/simple-markdown-resume-with-pandoc-and-wkhtmltopdf.html).
7+
8+
I modified the CSS for my taste, and noticed that some of the documentation needed to be updated.
9+
10+
Since Sonya's post is nearly five years old, there have been many changes to the command line utilities that she used, so I've updated this README to reflect those changes.
11+
12+
# Workflow
13+
14+
The workflow is pretty simple.
15+
16+
1. Edit the resume.md file.
17+
1. Run pandoc to convert the Markdown file to HTML. OR
18+
1. Run pandoc to convert the Markdown file into a PDF.
19+
20+
The big difference between Sonya's workflow is that if you want, you can convert from MD -> PDF in one step, rather than two. You can still go from MD -> HTML -> PDF, but if you don't want to have an HTML file, you don't have to.
21+
22+
I also don't feel like supporting/using Microsoft Word, so I'm not even trying to output to .docx.
23+
24+
# Updated instructions for a Mac .. or 2021
25+
26+
A lot has changed since Sonya wrote her blog post and shared her workflow, so here are some updates on how to get started and building/updating your own resume.
27+
28+
# Pre-Requisites
29+
30+
## [Pandoc](https://pandoc.org) a universal document converter
31+
32+
```bash
33+
brew install pandoc
34+
```
35+
36+
## [Wkhtmltopdf](https://wkhtmltopdf.org)
37+
38+
As of January 2023, this is not a supported project, so I'll be looking to change to some other provider soon.
39+
40+
```
41+
brew install wkhtmltopdf
42+
```
43+
44+
## Markdown to HTML
45+
46+
```
47+
pandoc resume.md -f markdown -t html -c resume-stylesheet.css -s -o resume.html
48+
```
49+
50+
## Markdown to PDF
51+
52+
```
53+
pandoc resume.md -f markdown -t pdf --pdf-engine=wkhtmltopdf -c resume-stylesheet.css -s -o resume.pdf
54+
```
55+
56+
## HTML to PDF
57+
58+
If you want to convert from HTML to PDF for some reason, you'll need to add a switch to wkhtmltopdf so that it works properly.
59+
60+
```
61+
wkhtmltopdf --enable-local-file-access resume.html resume.pdf
62+
```
63+
64+
# TODO
65+
66+
- [x] [github action](https://github.com/pandoc/pandoc-action-example) will run and create the HTML and PDF file automatically.
67+
- [ ] the Author field in the PDF, it seems to not work when the pdf-engine is set to wkhtmltopdf
68+
- [ ] make a release or a package?

0 commit comments

Comments
 (0)