Kishore Vancheeshwaran
Resume in yaml and jinja templates
100DaystoOffload resume plaintext jinja

In my previous post I created my resume using yaml and orgmode. Even though I was satisfied to an extent with this solution, I still felt there was a limitation in using orgmode as a middleware to export my yaml into pdf and html. I realised that this challenge was partially due to my obsession to using emacs and orgmode. The main thing I was unhappy with I cannot edit the templates being exported that easily without resorting to modifying emacs’s backend exporter. I needed a way to translate yaml to latex and html directly. Initially I started writing python scripts with a custom formatter but realised I was still trying to solve the wrong problem.

When I googled, I realised there is Jinja. Quoting from the documentation,

Jinja is a fast, expressive, extensible templating engine. Special placeholders in the template allow writing code similar to Python syntax. Then the template is passed data to render the final document.

This was wonderful and suited my needs. Searching further I could see other repositories here and here implementing this workflow. This workflow was much more straightforward.

A simple example is as below which can be expanded/modified for your use case.


name: Kishore Vancheeshwaran
  phone: +91-0000000000
  location: Bangalore, IN
  - company: Company 2
    position: Software Engineer
    team: Awesome
    start_date: Jan 2015
    location: Bangalore
      - I did something awesome
      - I automated some work
  - company: Company 1
    position: Software Engineer
    team: Awesome
    start_date: Jan 2005
    to_date: Dec 2014
    location: Bangalore
      - I did something awesome
      - I automated some work

import yaml
from jinja2 import Environment, FileSystemLoader
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("-t", "--type", required=False, help="type of resume")
parser.add_argument("-o", "--outfile", required=True, help="output file name")
parser.add_argument("-j", "--template", required=True, help="jinja template")
args = parser.parse_args()

with open("resume.yaml", "r") as fin:
    resume = yaml.safe_load(fin)

# style.css which we will embed in the html directly
# to avoid requiring the stylesheet separately
with open("style.css") as fin:
    style =
resume["style"] = style

# This modification is to make sure the syntax
# plays well with latex templates
env = Environment(

template = env.get_template(args.template)
with open(args.outfile, "w") as fout:


<!doctype html>
<!-- standard html stuff -->
<style type="text/css" media="screen">

  \VAR{resume['contact']['phone']} |
  <a href="mailto:\VAR{resume['contact']['email']}">\VAR{resume['contact']['email']}</a> |
  <a href="https://\VAR{resume['contact']['linkedin']}">\VAR{resume['contact']['linkedin']}</a>

  \BLOCK{for exp in resume['experience']}

  \BLOCK{for item in exp['summary']}



    \textbf{\Huge \scshape \color{TextColor} \VAR{resume['name']}} \\ \vspace{1pt}
    \small \VAR{resume['contact']['phone']} $|$ \href{mailto:\VAR{resume['contact']['email']}}{\VAR{resume['contact']['email']}} $|$
    \BLOCK{for item in exp['summary']}
    \item {\VAR{item}}


.PHONY: jake anon html image

all: pdf html

	python -t pdf -j latex.template -o resume_kishore.tex
	pdflatex resume_kishore.tex

	python -t html -j html.template -o resume_kishore.html

The benefits I can see in this approach is the use of python like syntax directly in the templating. Additionally the tempaltes are separated from the content.

Now I can make sure that I maintain my resume in plaintext and at the same time export it to different formats with a templating engine without worrying about a middle layer with customised exports. My process is finally(?) simplified.

If you would like to leave a comment, contact me via email.
Post 8/99 - part of 100DaystoOffload