Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from waynr/implement-standard-latex-resume-temp…
Browse files Browse the repository at this point in the history
…late

Implement standard latex resume template
  • Loading branch information
waynr committed Jun 8, 2017
2 parents 2feeedb + 1ff60b5 commit ac3d4c7
Show file tree
Hide file tree
Showing 4 changed files with 278 additions and 1 deletion.
50 changes: 49 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,55 @@ Populate a predefined LaTeX template with contents defined in YAML to build your
Features
--------

* TODO
Current
+++++++

N/A

Planned
+++++++

* Generate LaTeX resume from simple YAML list of attributes
* Supports Jinja2 templates
* Easily create new resume templates using cookiecutter

Roadmap
-------

* Version 0.1.0

* Tests

* [x] default template tests
* scenario-based

* [ ] default template tests
* [ ] exteranl git repo template tests (http://)
* [ ] exteranl git repo template tests (https://)
* [ ] exteranl git repo template tests (git://)
* [ ] exteranl git repo template tests (ssh://)

* unit tests

* [ ] Find/create docker image to provide latex packages
* Command line

* [ ] parameter to specify location of LaTeX templates

* LaTeX Templates

* Initial templates packaged w/ pyresume

* [x] Jinja2 template with basic layout
* [x] stored as setuptools resource

* External Templates

* [ ] From local file
* [ ] From git repo
* [ ] Cookiecutter repo for new template repos

* Examples

Credits
---------
Expand Down
193 changes: 193 additions & 0 deletions pyresume/templates/standard.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
\documentclass[10pt]{article} %Sets the default text size to 11pt and class to article.

\usepackage{multicol}
\usepackage[colorlinks=true]{hyperref}

\hoffset=0.0in
\voffset=0.0in

\textwidth=6.25in
\textheight=9.0in

\topmargin=0.0in

\oddsidemargin=0.0in
\evensidemargin=0.0in

\marginparwidth=0.0in
\marginparsep=0.0in

\headheight=0pt
\headsep=0pt

\begin{document}
\centerline{
\LARGE\textbf{ {{ basic.name }} }
}

{% set count=0 %}
{% for each in ["address", "contact", "websites"] %}
{% if each in basic %}
set count=count+1
{% endif %}

{% endfor %}

{% if count > 0 %}
\begin{multicols}{ {{count}} }
{% if "address" in basic %}
{% for line in basic.address %}
\centerline{ {{line}} }
{% endfor %}
{% endif %}

{% if "contact" in basic and basic.contact|length > 0 %}
\columnbreak
{% if "phone" in basic.contact %}
\centerline{ {{basic.contact.phone}} }
{% endif %}
{% if "email" in basic.contact %}
\centerline{
\href{ mailto:{{basic.contact.email}} }{ {{basic.contact.email}} }
}
{% endif %}
{% endif %}

{% if "websites" in basic and basic.websites|length > 0 %}
\columnbreak
{% for website in basic.websites %}
\centerline{
\href{ {{website.url}} }{ {{website.text}} }
}
{% endfor %}
{% endif %}
\end{multicols}
{% endif %}

{% if objective is not none %}
\vskip \medskipamount
\leaders\vrule width \textwidth\vskip0.8pt
\vskip \medskipamount
\nointerlineskip
\centerline{\Large Objective}
\smallskip

{{ objective }}

\bigskip
{% endif %}

{% if education is not none %}
\vskip \medskipamount
\leaders\vrule width \textwidth\vskip0.8pt
\vskip \medskipamount
\nointerlineskip
\centerline{\Large Education}
\smallskip

{% for school in education %}
\centerline{\large\bf
{{school.school}}
\hfill
{{school.startdate}} - {{school.enddate}}
}
\smallskip
{% if ("degrees" in school and
school.degrees|length > 0) %}
{% for degree in school.degrees %}
\noindent\textit{ {{degree}} }\\
{% endfor %}
{% endif %}
{% if ("achievements" in school and
school.achievements|length > 0) %}
{% for achievement in school.achievements %}
\indent\textit{ {{achievement}} }\\
{% endfor %}
{% endif %}
{% if "gpa" in school %}
\indent GPA: {{ school.gpa }}\\
{% endif %}
{% endfor %}
{% endif %}

{% if experience is not none %}
\vskip \medskipamount
\leaders\vrule width \textwidth\vskip0.8pt
\vskip \medskipamount
\centerline{\Large Experience}
\smallskip

{% for experience in experiences %}
\centerline{\large\bf
{{experience.company}}: {{experience.title}}
\hfill
{{experience.startdate}} - {{experience.enddate}}
}
\begin{itemize}
{% if experience.projects|length > 0 %}
{% for project in experience.projects %}
\item {{ project }}
{% endfor %}
{% endif %}
\item {{experience}}
\end{itemize}
{% endfor %}

{% endif %}

{% if (skills is not none and
skills|length > 0) %}
\vskip \medskipamount
\leaders\vrule width \textwidth\vskip0.8pt
\vskip \medskipamount
\nointerlineskip
\centerline{\Large Skills}

\begin{multicols}{ {{category.columns}} }
{% for category in skills %}
\noindent{\large\bf {{category.category}} }
\begin{itemize}
{% for item in category.items %}
\item {{item}}
{% endfor %}
\end{itemize}
{% endfor %}
\end{multicols}
\bigskip
{% endif %}

{% if (activities is not none and
activities|length > 0) %}
\vskip \medskipamount
\leaders\vrule width \textwidth\vskip0.8pt
\vskip \medskipamount
\nointerlineskip
\centerline{\Large Activities}
{% for activity in activities %}
\centerline{\large\bf
{{ activity.name }}
\hfill
{{activity.startdate}} - {{activity.enddate}}
}
{% endfor %}
\bigskip
{% endif %}

\vskip \medskipamount
\leaders\vrule width \textwidth\vskip0.8pt
\vskip \medskipamount
\nointerlineskip
\centerline{\Large References}
{% if (references is not none and
references|length > 0) %}
{% for reference in references %}
\centerline{\large\bf
{{ reference.name }}
\hfill
{{ reference.info }}
}
{% endfor %}
{% else %}
\noindent{\bf Available on Request}
{% endif %}
\end{document}
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
],
package_dir={'pyresume':
'pyresume'},
package_data={
'pyresume': 'templates/*.jinja2'
},
entry_points={
'console_scripts': [
'pyresume=pyresume.cli:main'
Expand Down
33 changes: 33 additions & 0 deletions tests/test_templates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
test_templates
----------------------------------
Tests for jinja2 LaTeX resume template files.
"""

import pkg_resources

from jinja2 import Environment


def test_standard_template_exists():
"""
Validate that the standard LaTeX template is available through pkg_resources
at the expected location.
"""
assert pkg_resources.resource_exists('pyresume',
'templates/standard.tex')


def test_standard_template_is_valid_jinja2_format():
"""
Validate that the standard LaTeX template is well-formed as far as Jinja2 is
concerned.
"""
env = Environment()
template_string = pkg_resources.resource_string('pyresume',
'templates/standard.tex').decode()
env.parse(template_string)

0 comments on commit ac3d4c7

Please sign in to comment.