prat0318 / json_resume Goto Github PK
View Code? Open in Web Editor NEWGenerates pretty HTML, LaTeX, markdown, with biodata feeded as input in JSON
Home Page: http://prat0318.github.io/json_resume
License: MIT License
Generates pretty HTML, LaTeX, markdown, with biodata feeded as input in JSON
Home Page: http://prat0318.github.io/json_resume
License: MIT License
Current implementation uses the locale settings as can be found in the gem's directory. This is very limiting and it would be helpful to support custom locales. Probably, the simplest is to use the approach as the one with the templates.
OS - OSX Yosemite. Ruby - ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
Error on running "json_resume --help"
json_resume:27:in <class:JsonResumeCLI>': undefined method
option' for JsonResumeCLI:Class (NoMethodError)
I've installed json_resume, pdfkit and wkhtmltopdf using gem install
in a RVM environment.
Even though I can access wkhtmltopdf from the shell:
$ which wkhtmltopdf /home/andre/.rvm/gems/ruby-2.1.2/bin/wkhtmltopdf $
pdfkit cannot find the path itself:
$ json_resume convert --out=html_pdf andre_miras_cv.json Generating the html_pdf type... /home/andre/.rvm/gems/ruby-2.1.2/gems/pdfkit-0.6.2/lib/pdfkit/pdfkit.rb:32:in `initialize': No wkhtmltopdf executable found at Could not locate Gemfile (PDFKit::NoExecutableError) >> Please install wkhtmltopdf - https://github.com/pdfkit/PDFKit/wiki/Installing-WKHTMLTOPDF from /home/andre/.rvm/gems/ruby-2.1.2/gems/json_resume-0.3.2/bin/json_resume:68:in `new' from /home/andre/.rvm/gems/ruby-2.1.2/gems/json_resume-0.3.2/bin/json_resume:68:in `convert_to_html_pdf' from /home/andre/.rvm/gems/ruby-2.1.2/gems/json_resume-0.3.2/bin/json_resume:20:in `convert' from /home/andre/.rvm/gems/ruby-2.1.2/gems/thor-0.19.1/lib/thor/command.rb:27:in `run' from /home/andre/.rvm/gems/ruby-2.1.2/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command' from /home/andre/.rvm/gems/ruby-2.1.2/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch' from /home/andre/.rvm/gems/ruby-2.1.2/gems/thor-0.19.1/lib/thor/base.rb:440:in `start' from /home/andre/.rvm/gems/ruby-2.1.2/gems/json_resume-0.3.2/bin/json_resume:131:in `' from /home/andre/.rvm/gems/ruby-2.1.2/bin/json_resume:23:in `load' from /home/andre/.rvm/gems/ruby-2.1.2/bin/json_resume:23:in `' from /home/andre/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval' from /home/andre/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `' $
Hardcoding the path in PDFKit.configure do |config|
block of the convert_to_html_pdf method temporary solved the issue:
PDFKit.configure do |config| # dirty "PDFKit::NoExecutableError" workaround config.wkhtmltopdf = '/home/andre/.rvm/gems/ruby-2.1.2/bin/wkhtmltopdf' config.default_options = { :footer_right => "Page [page] of [toPage] .\n", :footer_font_size => 10, :footer_font_name => "Georgia" } end
Unless pdfkit was installed properly and could find wkhtmltopdf by itself (e.g. which wkhtmltopdf
), we could workaround this issue in json_resume by allowing the user to provide wkhtmltopdf path from command line.
This is some how related to #5, but not a duplicate.
I can try to come with a pull request later if you want me to, even though I'm not a Ruby dev.
Question about format of json file, is https://github.com/jsonresume/resume-schema used?
Resultant tex_pdf will look like: https://www.writelatex.com/1272746qpbpss
command option will be: classic_tex, classic_tex_pdf (Two more options will be added default_tex, default_tex_pdf which will default to tex and tex_pdf respectively)
json_resume convert --out=tex_pdf ./petrus_resume.json
Generating the tex_pdf type...
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in encode': "\xE2" on US-ASCII (Encoding::InvalidByteSequenceError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in
initialize'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in new' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in
parse'
from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/lib/json_resume/reader.rb:20:in initialize' from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/lib/json_resume/json_resume.rb:15:in
new'
from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/lib/json_resume/json_resume.rb:15:in initialize' from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/lib/json_resume/json_resume.rb:7:in
new'
from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/lib/json_resume/json_resume.rb:7:in new' from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/bin/json_resume:121:in
generate_file'
from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/bin/json_resume:76:in convert_to_tex' from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/bin/json_resume:81:in
convert_to_tex_pdf'
from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/bin/json_resume:20:in convert' from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in
run'
from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch'
from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /Library/Ruby/Gems/2.0.0/gems/json_resume-0.3.2/bin/json_resume:131:in
<top (required)>'
from /usr/bin/json_resume:23:in load' from /usr/bin/json_resume:23:in
I try to make the font-size smaller, but it will leave margin on both side of page.
It would be great to have support for minor
in the bio_data.education.schools
sections.
And maybe it would be useful to support arrays for major
, which people could use for double majors. Though this is probably more complex than it's worth, when you could just have both majors in one string.
{
"linkedin_id": "123",
"github_id": "example",
"bio_data": {
"email": "[email protected]",
"website": "http://exampled.com"
}
}
The URLs generated are
:
)Thanks for your OSS.
I wish to create a project for our own CV, so could I use some of the files (like the template) without the whole project (since we will do another design) ?
In the website of the project, when you try to see the examples of html version, a message appears: "This page has been blocked by Kerio Control". It seems an issue with firewall is messing with an ajax request.
Nice project, I'm very gratefull ;)
I'm writting my cv
now, but all the time when I save a file I need to go my terminal and type json_resume
again. If it had a way to make rebuild every time I change a file.
Can be like json_resume convert file.json --watch
What you think about it?
Thank you for contributing to this excellent project.
I think there should be a key like href
in papers/publications section to add href attribute to paper title. For example,
"papers": {
"items": [
{
"authors":"imtypist",
"title":"This is a title",
"href":"http://xxx.com", // add the key 'href'
"misc":"Journal of Computer Applications, August 2017"
}
]
}
Or you can delete the mark <a>
outside title in HTML template, then we can use markdown-style to add a link to paper title. For example,
"papers": {
"items": [
{
"authors":"imtypist",
"title":"[This is a title](http://xx.com)", // use markdown-style
"misc":"Journal of Computer Applications, August 2017"
}
]
}
I think the latter may be easier to modify.
Add support for different languages.
I'd love to help with Spanish, and a PR with the basic mechanism for i18n templating.
Can we discuss the implementation?
Hi,
I would like to add a new element in the education table (starting year). I managed to do it manually:
en.yml
I managed to make it work. However, I would like to develop this further in my fork. To that end, I have a question:
I installed the tool using the gem install
. How could I replace this with my fork? How to install/deploy changes that I make in my fork? Sorry for the naive question, I have never wrote anything in Ruby...
It'd be awesome if you added support for YAML, since it's a little more human friendly for both reading and writing than JSON.
#
and other special characters are not escaped when generating the LaTeX output. This then causes errors when using the generated tex file.
When compiling to tex_pdf
with Ruby 2.1.3, single quotes in some (not all) fields -- like bio_data.other_projects.items[0].time
-- appear to get converted to XML-like escape codes: '
. This isn't a problem with 1.9.3. Intended behavior, or a bug?
After installing json_resume and trying to convert it to a pdf (--out=pdf and --out=html_pdf), I see this error:
Generating the html_pdf type...
/var/lib/gems/1.9.1/gems/pdfkit-0.6.2/lib/pdfkit/pdfkit.rb:32:in `initialize': No wkhtmltopdf executable found at (PDFKit::NoExecutableError)
>> Please install wkhtmltopdf - https://github.com/pdfkit/PDFKit/wiki/Installing-WKHTMLTOPDF
from /var/lib/gems/1.9.1/gems/json_resume-0.3.2/bin/json_resume:68:in `new'
from /var/lib/gems/1.9.1/gems/json_resume-0.3.2/bin/json_resume:68:in `convert_to_html_pdf'
from /var/lib/gems/1.9.1/gems/json_resume-0.3.2/bin/json_resume:20:in `convert'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /var/lib/gems/1.9.1/gems/json_resume-0.3.2/bin/json_resume:131:in `<top (required)>'
from /usr/local/bin/json_resume:23:in `load'
from /usr/local/bin/json_resume:23:in `<main>'
The fix is to install the following:
apt-get install libfontconfig1
gem install wkhtmltopdf
This should probably be documented somewhere.
Just pulled in the latest gem update and I'm seeing a different error now, convert_to_pdf
method missing:
┌─[jonathan@thinkpad]─[~/tmp]
└──╼ json_resume convert --out=pdf resume.json
Generating the pdf type...
/var/lib/gems/1.9.1/gems/json_resume-1.0.1/bin/json_resume:29:in `convert': undefined method `convert_to_pdf' for #<JsonResumeCLI:0x0000000319c460> (NoMethodError)
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /var/lib/gems/1.9.1/gems/json_resume-1.0.1/bin/json_resume:170:in `<top (required)>'
from /usr/local/bin/json_resume:23:in `load'
from /usr/local/bin/json_resume:23:in `<main>'
┌─[✗]─[jonathan@thinkpad]─[~/tmp]
└──╼ json_resume convert --out=pdf resume.json
Generating the pdf type...
/var/lib/gems/1.9.1/gems/json_resume-1.0.1/bin/json_resume:29:in `convert': undefined method `convert_to_pdf' for #<JsonResumeCLI:0x00000001f8d5d0> (NoMethodError)
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /var/lib/gems/1.9.1/gems/json_resume-1.0.1/bin/json_resume:170:in `<top (required)>'
from /usr/local/bin/json_resume:23:in `load'
from /usr/local/bin/json_resume:23:in `<main>'
Am I doing something wrong? Using --out=tex_pdf works
since it pushes it to writelatex.com.
/home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/mustache-0.99.6/lib/mustache/template.rb:3842:in block in render': incompatible character encodings: ISO-8859-1 and UTF-8 (Encoding::CompatibilityError) from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/mustache-0.99.6/lib/mustache/template.rb:3842:in
map'
from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/mustache-0.99.6/lib/mustache/template.rb:3842:in render' from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/mustache-0.99.6/lib/mustache/template.rb:43:in
render'
from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/mustache-0.99.6/lib/mustache.rb:124:in render' from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/mustache-0.99.6/lib/mustache.rb:85:in
render'
from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/json_resume-1.0.2/bin/json_resume:167:in generate_file' from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/json_resume-1.0.2/bin/json_resume:66:in
convert_to_html'
from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/json_resume-1.0.2/bin/json_resume:29:in convert' from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/thor-0.19.1/lib/thor/command.rb:27:in
run'
from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch'
from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /home/vagrant/.rvm/gems/ruby-2.1.2@global/gems/json_resume-1.0.2/bin/json_resume:176:in
<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.2/bin/json_resume:23:in load' from /home/vagrant/.rvm/rubies/ruby-2.1.2/bin/json_resume:23:in
eval' from /home/vagrant/.rvm/gems/ruby-2.1.2@global/bin/ruby_executable_hooks:15:in
'As suggested by Noah Hines.
Getting the following errors when trying to convert to pdf
$ json_resume convert --out=pdf juanpaulo_cv.json
Generating the pdf type...
/Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/json_resume-0.3.2/bin/json_resume:20:in `convert': undefined method `convert_to_pdf' for #<JsonResumeCLI:0x007ff8a26ada90> (NoMethodError)
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/json_resume-0.3.2/bin/json_resume:131:in `<top (required)>'
from /Users/juanpaulo/.rbenv/versions/2.1.2/bin/json_resume:23:in `load'
from /Users/juanpaulo/.rbenv/versions/2.1.2/bin/json_resume:23:in `<main>'
Same thing happens when trying to convert to html_pdf
$ json_resume convert --out=html_pdf juanpaulo_cv.json
Generating the html_pdf type...
/Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/pdfkit-0.6.2/lib/pdfkit/pdfkit.rb:32:in `initialize': No wkhtmltopdf executable found at (PDFKit::NoExecutableError)
>> Please install wkhtmltopdf - https://github.com/pdfkit/PDFKit/wiki/Installing-WKHTMLTOPDF
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/json_resume-0.3.2/bin/json_resume:68:in `new'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/json_resume-0.3.2/bin/json_resume:68:in `convert_to_html_pdf'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/json_resume-0.3.2/bin/json_resume:20:in `convert'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/juanpaulo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/json_resume-0.3.2/bin/json_resume:131:in `<top (required)>'
from /Users/juanpaulo/.rbenv/versions/2.1.2/bin/json_resume:23:in `load'
from /Users/juanpaulo/.rbenv/versions/2.1.2/bin/json_resume:23:in `<main>'
By the way, I tried it on both 2.0.0-p353 and 2.1.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.