Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specify a theme in options.json file #197

Closed
oupala opened this issue Apr 25, 2017 · 6 comments
Closed

specify a theme in options.json file #197

oupala opened this issue Apr 25, 2017 · 6 comments

Comments

@oupala
Copy link

oupala commented Apr 25, 2017

I can generate my resume using a locally installed theme by specifying it on the command line:

node node_modules/hackmyresume/dist/cli/index.js BUILD resume.json TO resume.html --theme node_modules/jsonresume-theme-elegant

where the jsonresume-theme-elegant is locally installed in the node_modules directory.

But when I try to do the same using a json configuration file, it seems to fail and to fallback to the MODERN theme:

node node_modules/hackmyresume/dist/cli/index.js BUILD resume.json TO resume.html --options options.json

And the options.json file looks like that:

{
  // Set the default theme to "compact"
  //"theme": "node_modules/jsonresume-theme-elegant",
  //"theme": "jsonresume-theme-elegant",
  "theme": "elegant",
  // Change the "employment" section title text to "Work"
  "sectionTitles": {
    "employment": "Work"
  }
}

I've tried many ways to specify the relative path to the theme (see above), but none of them seems to work.

Is it possible to specify the theme via a json options file?

@ryneeverett
Copy link
Contributor

Normal relative path syntax works for me: "theme": "./jsonresume-theme-elegant".

@oupala
Copy link
Author

oupala commented Apr 26, 2017

Thanks a lot @ryneeverett for your answer. As it is working for you, I tried again and again.

I finally tried to validate my options.json file and it appears that it was not valid as it contains comments, and json cannot contain comments.

I remove comments and now my options are effective.

The documentation should be updated to remove comments...

@ryneeverett can you try to add some comments in your options.json file and see if it still works?

@ryneeverett
Copy link
Contributor

ryneeverett commented Apr 26, 2017

See #192 and #185. While there are several ways we could improve the situation, I think @peternowee's suggestion that we raise a warning when the options file doesn't validate is the best so far.

@hacksalot
Copy link
Owner

I think @peternowee's suggestion that we raise a warning when the options file doesn't validate is the best so far.

Agreed.

@hacksalot
Copy link
Owner

hacksalot commented Jan 29, 2018

Something like...

λ hackmyresume build foo/bar/resume.json to rez.doc -o ../test-options.json
Error: The specified options file is invalid:
Invalid or corrupt JSON on line 3 column 3.
Make sure the options file contains valid JSON.

Similarly for the case of a missing or inaccessible options file.

@hacksalot
Copy link
Owner

hacksalot commented Feb 1, 2018

Closing as the requested behavior (options file validation) is in place for v1.9.0. Thanks!

@hacksalot hacksalot self-assigned this Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants