Improving Short CV

pull/1/head
Oliver Kennedy 2017-10-24 18:24:55 -04:00
parent 53f4f84b6d
commit b851987eea
3 changed files with 56 additions and 17 deletions

View File

@ -16,4 +16,10 @@ $> open build/index.html
```
Details of the repository's organization and how to upload files are in
[CONTRIBUTING.md](CONTRIBUTING.md).
[CONTRIBUTING.md](CONTRIBUTING.md).
## Installing Rake & Dependencies
```
$> sudo gem install rake redcarpet prawn
```

View File

@ -170,18 +170,26 @@ file "okennedy_short.tex" => (["db/cv/okennedy.json", "lib/cv.rb", "Rakefile"]+D
title: "Recent Activities",
since: {
education: 2008,
reviewer: 2015,
general_service: 2015,
volunteering: 2015,
talks: 2015,
courses: 2015,
publications: 2014
reviewer: 2017,
general_service: 2017,
volunteering: 2012,
talks: 2017,
courses: 2014,
publications: 2017,
},
skip: [
:contact,
:employment,
:memberships,
:dept_service,
:tech_reports
# :dept_service,
:tech_reports,
:general_service,
:reviewer,
# :publications,
:artifacts,
],
abbreviate: [
:grants
]
)
end

View File

@ -40,6 +40,7 @@ class CV < Latex::Builder
@since = Hash.new { |h,k| if h.has_key? :rest then h[:rest] else 0 end }
options[:since].each { |k, v| @since[k] = v } if options.has_key?(:since)
@skip = options.fetch(:skip, [])
@abbreviate = options.fetch(:abbreviate, [])
gen
end
@ -73,8 +74,10 @@ class CV < Latex::Builder
render_header
vspace "0.15in"
render_contact_details
vspace! "-0.1in"
unless skip?(:contact)
render_contact_details
vspace! "-0.1in"
end
render_education unless skip?(:education)
render_employment_history unless skip?(:employment)
@ -84,7 +87,8 @@ class CV < Latex::Builder
render_invited_talks unless skip?(:invited_talks)
render_courses_taught unless skip?(:courses)
render_grant_support unless skip?(:grants)
render_pubs_and_artifacts unless skip?(:pubs)
render_short_grant_support if @abbreviate.include? :grants
render_pubs_and_artifacts unless skip?(:publications)
end
end
@ -100,7 +104,13 @@ class CV < Latex::Builder
end
def skip?(category)
@skip.include? category
@skip.include? category or @abbreviate.include? category
end
def since_title_subscript(category)
if @since.has_key? category
" (since #{@since[category]})"
else "" end
end
@ -254,7 +264,7 @@ class CV < Latex::Builder
############### INVITED TALKS ################
def render_invited_talks
make_section("Invited Talks")
make_section("Invited Talks"+since_title_subscript(:talks))
build_filtered_itemize(:talks, @data["talks"], "noitemsep,leftmargin=5mm,label=--") do |r|
textit { puts r["venue"] }
wrap {
@ -271,7 +281,7 @@ class CV < Latex::Builder
############### COURSES ################
def render_courses_taught
make_section("Courses")
make_section("Courses Taught"+since_title_subscript(:courses))
courses = @data["courses"]
@ -307,7 +317,7 @@ class CV < Latex::Builder
############### GRANT SUPPORT ################
def render_grant_support(args = {})
make_section("Grant Support")
make_section("Grant Support"+since_title_subscript(:grants))
test_for_since = proc { |r| duration_is_since?(r, @since[:grants]) }
@ -445,6 +455,21 @@ class CV < Latex::Builder
end # grant_categories.each
end
def render_short_grant_support
make_section("Grant Support"+since_title_subscript(:grants))
test_for_since = proc { |r| duration_is_since?(r, @since[:grants]) }
grants = @data["grants"].select { |r|
r["status"] == "accepted" and test_for_since.call(r)
}
build_itemize(grants, "noitemsep,leftmargin=5mm,label=--") do |r|
copis = r.fetch("copis", [])
copi_string = if copis.empty? then "" else "; with "+copis.oxford_comma end
puts "#{r["title"]} (#{format_money r["amount"]} from #{r["agency"].split(/:/)[0]}#{copi_string})"
end
end
############### PUBLICATIONS AND ARTEFACTS ################
@ -556,7 +581,7 @@ class CV < Latex::Builder
all_my_pubs = LabMetadata.publications_for(@who)
make_section("Publications and Artifacts")
make_section("Publications and Artifacts"+since_title_subscript(:publications))
# block("center") do
# puts "(Author lists marked with a * are not correlated with level of contribution)"