Skip to content

Instantly share code, notes, and snippets.

@bjjb
Created May 19, 2012 17:55
Show Gist options
  • Save bjjb/2731707 to your computer and use it in GitHub Desktop.
Save bjjb/2731707 to your computer and use it in GitHub Desktop.
Template for a CV
!!! 5
%html(lang="en")
%head
%title= title
%style(href='cv.css')
%body
:markdown
#{body}
Curriculum Vitae
================
{{name}} _{{tagline}}_
*{{{headline}}}*
_Name:_ {{name}}
_E-mail_ {{email}}
_Nationality:_ {{nationality}}
_Date of Birth:_ {{date_of_birth}}
Education
---------
{{#education}}
* {{qualification}} _({{institution}})_
{{/education}}
Experience
----------
{{#experience}}
### [{{company}}]({{id}}) _({{from}} - {{to}})_ ![Logo]({{id}}.png)
{{#position}}
* {{{to_s}}}
{{/position}}
{{{overview}}}
{{/experience}}
Spoken languages
----------------
{{#spoken_languages}}
* {{to_s}}
{{/spoken_languages}}
Computer languages
------------------
_In descending order of familiarity and preference_
{{#computer_languages}}
* {{to_s}}
{{/computer_languages}}
Hobbies
-------
{{#hobbies}}
* {{to_s}}
{{/hobbies}}
Links
-----
{{#links}}
* [{{name}}]({{href}})
{{/links}}
References are available on request.
This CV is also in [HTML](cv.html), [JSON](cv.json), [XML](cv.xml) and
[YAML](cv.yml). The source for this page is available [here](git://gist.github.com/2731707.git)
{{#experience}}
[{{id}}]: {{website}}
{{/experience}}
---
name: Joseph Bloggs
goes_by:
- Joe
- Jojo
tagline: Job-seeker
headline: >
Looking for work.
date_of_birth: 1970-01-01
email: joe@example.com
nationality: Spanish
spoken_languages:
- English
- Irish
- Urdu
computer_languages:
# in descending order of experience and comfort
- Ruby
- Haskal
- Fortran
education:
- qualification: PHd in Illiteracy Studies
institution: UCLA
experience:
# in chronological order
- company: Acme
from: "1960"
to: "2012"
position:
- Intern
overview: |
Dealt with customer complaints from coyotes.
website: http://www.example.com
id: example
hobbies:
- Kites
- Throwing bottles
links:
- name: Link One
href: http://example.com
- name: Link 2
href: http://example.com
other_formats:
- yml
- txt
- json
- xml
- html
require 'active_support/core_ext/hash/conversions'
require 'rake/clean'
require 'json'
require 'yaml'
require 'maruku'
require 'mustache'
require 'ostruct'
require 'haml'
CLEAN.include(%w|*.html *.xml *.json *.txt|)
@cv = YAML.load_file('cv.yml')
file 'cv.json' => 'cv.yml' do |t|
File.open(t.name, 'w') { |f| f.print(@cv.to_json) }
end
file 'cv.xml' => 'cv.yml' do |t|
File.open(t.name, 'w') { |f| f.print(@cv.to_xml) }
end
file 'cv.txt' => FileList['cv.yml', 'cv.mustache'] do |t|
File.open(t.name, 'w') do |f|
f.print(Mustache.render(File.read(t.name.ext('mustache')), @cv))
end
end
file 'cv.css' => 'cv.sass' do |t|
File.open(t.name, 'w') { |f| f.print(Sass::Engine.new(File.read(t.name)).render) }
end
rule 'cv.html' => FileList['cv.haml', 'cv.txt', 'cv.css', 'cv.yml'] do |t|
cv = OpenStruct.new(@cv)
cv.css = File.read('cv.css')
cv.body = File.read('cv.txt')
File.open(t.name, 'w') do |f|
f.print Haml::Engine.new(File.read(t.name.ext('haml'))).render(cv)
end
end
task :default => FileList['cv.json', 'cv.xml', 'cv.txt', 'cv.html']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment