Skip to content

Commit

Permalink
Improvements to contact processing and readme
Browse files Browse the repository at this point in the history
- put the contact box at the top of the document rather than where the
  contact lines are extracted from (below the header), so it appears
  aligned with the top of the name header as before

- support both multi-line and bullet-separated contact details
  • Loading branch information
mwhite committed Jul 16, 2012
1 parent d388dc5 commit c41b1e9
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
37 changes: 22 additions & 15 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
This is a simple resume in Markdown. You can create PDF and HTML versions by
running `make` if you have the document processor
[Pandoc](http://johnmacfarlane.net/pandoc/) installed. You can modify
resume.css to change the appearance of the HTML output and header.tex for the
PDF output.
This is a simple Markdown resumé template and LaTeX header that can be used with
[Pandoc](http://johnmacfarlane.net/pandoc/) to create a professional-looking
PDF.

Pandoc >= 1.9 is assumed; you can modify the Makefile to change this.
Dependencies
------------

In order to enable visually appealing display of contact information, a Python
pre-processing script looks to see if the fourth line of the markdown input
contains items separated by Unicode bullets; if it does, they are extracted and
displayed in a right-aligned, zero-height box in the PDF output generated from
LaTeX.
* Pandoc >= 1.9 (you can adjust the Makefile to use an earlier version)
* Python
* The Tex Gyre Pagella font, available on Debian/Ubuntu from the `tex-gyre`
package

The default resumé font is Tex Gyre Pagella, which you can install with the
Debian/Ubuntu package `tex-gyre`.
Usage
-----

The default resume.md contains boilerplate content. Check out the `mwhite`
branch for an actual resume.
Simply run `make` to generate PDF and HTML versions of each .md file in the
directory.

In order to enable visually appealing display of contact information, the
Markdown is passed through a Python script that looks for contact details
beginning on the fourth line and moves them into a right-aligned, zero-height
box at the top of the document. Lines with bullets (•) will be treated as
separate contact lines in the output.

The included resume.md contains boilerplate content. Take a look at the
`mwhite` branch for an actual resume.
20 changes: 13 additions & 7 deletions process.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# encoding: utf-8

import sys
import re

lines = sys.stdin.readlines()

for i, line in enumerate(list(lines[3:])):
stripped = line.strip()
if not stripped:
# Contact details are expected to begin on the fourth line, following the
# header and a blank line, and extend until the next blank line. Lines with
# bullets (•) will be split into separate lines.
contact_lines = []
for line in lines[3:]:
lines.remove(line)
parts = [x.strip() for x in line.split("•")]
if parts == ['']:
break
lines[3 + i] = "\n%s\n" % stripped

contact_lines.extend(parts)

lines.insert(3, "\\begin{nospace}\\begin{flushright}")
lines.insert(4 + i, "\\end{flushright}\\end{nospace}\n")
lines.insert(0, "\\begin{nospace}\\begin{flushright}\n" +
"\n\n".join(contact_lines) +
"\n\\end{flushright}\\end{nospace}\n")

print "".join(lines)
2 changes: 1 addition & 1 deletion resume.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>
<h1 id="john-q.-public">John Q. Public</h1>
<p>foo@bar.com • 1 Main St., Anytown, USA • (555) 867-5309</p>
<p>foo@bar.com • (555) 867 5309 123 Main St. Anytown, USA</p>
<h2 id="work-experience">Work Experience</h2>
<ul>
<li><p><strong>An Employer</strong> (Some Place)</p>
Expand Down
3 changes: 1 addition & 2 deletions resume.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
John Q. Public
==============

foo@bar.com
foo@bar.com • (555) 867 5309
123 Main St.
Anytown, USA
555 867 5309

Work Experience
---------------
Expand Down
Binary file modified resume.pdf
Binary file not shown.

0 comments on commit c41b1e9

Please sign in to comment.