diff --git a/README.rst b/README.rst index ace6b7b..7bf06c0 100644 --- a/README.rst +++ b/README.rst @@ -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 --------- diff --git a/pyresume/templates/standard.tex b/pyresume/templates/standard.tex new file mode 100644 index 0000000..00b2d54 --- /dev/null +++ b/pyresume/templates/standard.tex @@ -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} \ No newline at end of file diff --git a/setup.py b/setup.py index b105220..b6a7e99 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,9 @@ ], package_dir={'pyresume': 'pyresume'}, + package_data={ + 'pyresume': 'templates/*.jinja2' + }, entry_points={ 'console_scripts': [ 'pyresume=pyresume.cli:main' diff --git a/tests/test_templates.py b/tests/test_templates.py new file mode 100644 index 0000000..e37ba8f --- /dev/null +++ b/tests/test_templates.py @@ -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)