Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timsainb/curriculum_vitae
My Curriculum Vitae, generated in Python via Jinja from JSON fields into HTML. http://timsainburg.com/pages/cv.html
https://github.com/timsainb/curriculum_vitae
Last synced: about 1 month ago
JSON representation
My Curriculum Vitae, generated in Python via Jinja from JSON fields into HTML. http://timsainburg.com/pages/cv.html
- Host: GitHub
- URL: https://github.com/timsainb/curriculum_vitae
- Owner: timsainb
- Created: 2019-06-07T17:32:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-31T00:27:44.000Z (over 1 year ago)
- Last Synced: 2024-10-14T15:42:12.268Z (3 months ago)
- Language: HTML
- Size: 9.34 MB
- Stars: 11
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### Tim Sainburg Curriculum Vitae
This repo makes an HTML Curriculum Vitae (CV) from a set of json files. It is [based on Colin Raffel's CV](https://github.com/craffel/craffel.github.io)## Usage
If all you want to do is generate an HTML file, just run `python3 generate.py`. It will look inside of templates, and generate HTML using Jinja from those templates and the related JSON files (inside of data).For my own specific uses, I created a Makefile, that will need to be re-created specifically for your use case. That file is just used to do things like git push the updated CV repo, copy files over to my websites repo, build that repo, and push it it github. To run the makefile, just run `make buildwebsite` or another make command.
### Quick explanation
Data is stored in a JSON, like this:
```
{"research":
[
{
"Organization": "University of California, San Diego",
"lab": "Auditory Neurscience Laboratory",
"location": "La Jolla, CA",
"advisor": "Timothy Q Gentner",
"start": "2015",
"end": "now",
"title": "PhD Student"
}
]
}
```The `.tpl` Jinja template for the HTML output, is generated using the JSON data, like this:
```
Tim Sainburg: Curriculum Vitae
Education
{% for item in education %}
{{item.start}}–{{item.end}}
{{item.place}}
{{item.degree}}
{% if item.lab %}{{item.lab}}
{% endif %}
{% if item.advisor %}Advisor: {{item.advisor}}
{% endif %}
{% endfor %}
```
This is all orchestrated by the `generate.py` script, which just finds all of the json files, loads them up, generates the HTML from .tpl, and writes it to a file:
```
env = jinja2.environment.Environment(
loader=jinja2.FileSystemLoader('/MY/TEMPLATE/PATH')
)
template = env.get_template('MYTEMPLATE.TPL')
with open('/MY/OUTPUT/PATH/MYTEMPLATE.HTML', "w") as f:
f.write(template.render(**data))
```