Maintaining your CV with Markdown and Emacs

Published by at 29th August 2016 3:40 pm

I've recently been job-hunting, so that has meant having to update my CV. Fortunately, I've got into the habit of keeping it up to date easily by writing it in Markdown and generating it in the required format on demand. That way I can easily convert it to HTML, PDF or Microsoft DocX format as and when I need it. I thought I'd share this method as it works very well for me.

Maintaining your CV in Emacs?

Yes, you read that right! Although I'm a die-hard Vim user, I do use Emacs for a few things. One of them is time-tracking using org-mode, and another is maintaining my CV.

First of all you'll need to install pandoc, texlive and markdown. On Ubuntu this is easily done using apt-get:

$ sudo apt-get install pandoc markdown texlive

You'll also need to install Emacs and the appropriate packages, namely markdown-mode and markdown-mode+. To do so, first ensure this is in your .emacs.d/init.el:

1(require 'package)
2(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
3(package-initialize)
4
5;; Markdown support
6(require 'markdown-mode)
7(require 'markdown-mode+)
8(setq markdown-command "/usr/bin/markdown")
9(add-to-list 'auto-mode-alist '("\\.markdown$" . markdown-mode))
10(add-to-list 'auto-mode-alist '("\\.md$" . markdown-mode))
11(setq markdown-css-paths `(,(expand-file-name "Documents/markdown.css")))

Then fire up Emacs, ignoring the warnings you get, and run M-x package-list-packages to load the list of available packages. I'll leave navigating and installing this list of packages to you, but once they're done you should have everything you need.

This assumes the stylesheet you wish to use is at ~/Documents/markdown.css - adjust the path if necessary. You may also need to amend the path to your Markdown install if the location differs. You can put what you like in the stylesheet, but my advice is to keep it as simple as you can - it's your CV, not a web page. Here's what I use:

1body {
2 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
3 width: 80%;
4 margin: auto;
5 background: #ffffff;
6 padding: 10px;
7}
8
9h2 {
10 font-size: 30px;
11 color: #757575;
12 text-align: center;
13 margin-bottom: 15px;
14}
15
16h1 {
17 font-size: 55px;
18 color: #757575;
19 text-align: center;
20 margin-bottom: 15px;
21}
22
23hr {
24 color: #000000;
25}
26
27ul li {
28 list-style-type: disc;
29}
30
31blockquote {
32 text-align: center;
33}
34
35a, a:visited, a:hover {
36 text-decoration: none;
37 color: #000000;
38}
39
40code {
41 white-space: pre-wrap;
42 word-wrap: break-word;
43}

Next, we write our CV in Markdown. Here's a sample one based on mine:

1James Smith
2============
3
4About me
5--------
6
7I'm a full-stack web developer. I have built a wide variety of web applications (including single-page web apps), content based sites and REST APIs.
8
9---
10
11Skills
12----------
13* HTML5
14* CSS, Sass and Compass
15* Javascript, including Angular.js
16* PHP, including Laravel and Lumen
17
18---
19
20Employment
21----------
22
23**Agency ltd**
24June 2014 - present
25
26I worked for a busy digital agency, building custom web apps using Laravel and Angular.js
27
28---
29
30Education
31----------
32
33* **2009-2014 My Secondary School, London** - 7 GCSEs:
34
35---
36
37Hobbies and Interests
38---------------------
39
40Real ale, learning more about webdev, reading, socialising.
41
42---
43
44Contact
45-------
46
47> **Mobile:** 01234 567890
48
49> **[Email](mailto:user@example.com)** - **[Website](http://www.example.com)** - **[GitHub](https://github.com/username)**

Now, if you save this file as something like cv.md and then open it up in Emacs, you should be able to preview it in your browser with C-c C-c p. Nice, huh? To export it to HTML, run C-c C-c v instead.

What if you want to view it in other formats? Say a potential employer is asking for your CV in Microsoft DocX format (ugh...)? Just run this command in the shell:

$ pandoc -s -S cv.md -o cv.docx

Or how about PDF?

$ pandoc -s -S cv.md -o cv.pdf

Using this method it's straightforward to maintain a single master copy of your CV which you can then convert to other formats on demand.

Keeping your CV backed up

If you want to keep your CV safe, there's a couple of ways to do it. One is to keep it in a Git or Mercurial repository, and another is to use Dropbox to keep it in sync. I tend to use the latter approach, although I'm considering switching to the former. If you wanted to generate the various versions automatically, you could set up a hook to generate the various versions using Pandoc during the commit process.

I used to hate updating my CV, but that was largely because I left it too long, and often had nothing much to put on it. Nowadays I'm often learning something new so I quite often have reason to update it to reflect that, and adopting this workflow has made things a lot easier.