-
Notifications
You must be signed in to change notification settings - Fork 389
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
Cannot use themes through CLI #408
Comments
Has it been resolved? |
I find that one the theme is installed globally it is working properly. The bellow discussion comment might help you. |
I also think this process has been too confusing for a while. We need a reliable way to people to export from any theme that is on npm or relative to their system. |
I get the same error message when I have a syntax error in my JSON file; so, in my case, the message is clearly wrong. |
Same issue, and my JSON file has no error. Edit: Actually for me it does not work when i want to export to PDF. HTML export work fine. |
Has anyone found a solution to this? Also having the issue using |
Since i'm not fluent in JavaScript i ended up writing my own resume-cli in Python (and converting themes to Jinja). I wonder if it's caused by "PDF converting engine" not being able to load/execute "external" assets (CSS, JS, pictures) from the theme. I've had similar issues with my tool. |
I want to know how to use this but without knowing how to export in different themes, I can't make use of resume-cli! I'm on Kubuntu 20.10 and I get the same issues as the original poster mentioned here. Can someone please help? |
Hello, Here is my WA solution: adding script in package.json file |
I've looked through the CLI source code and found an easy workaround until this gets properly patched:
|
Nailed it. Can't think of an easier way to do this myself...? |
This looked promising, but I find I'm still having a (different) error if I try this method. Any run into this?
|
I was installing the dependency in both local and global context for this to work. Anyway, having to install a theme in the global context doesn't make sense to me. The problem is that the HTML render access the package in the local context, while the PDF export requires it to be global. With the workaround IMO theme packages paths should be handled in two ways in the entire project, as a summary:
I think the access of the package theme should be unified in some point, but by now with the fix in #673 should be working fine. |
Some of you might have much better chance with https://github.com/rbardini/resumed (an alternative CLI) They specifically mention this problem as something they wanted to fix. That being said, great ideas @davcd. I will test and merge in your PR now. (#673) |
Published on NPM -> https://www.npmjs.com/package/resume-cli/v/3.0.6 |
The only thing that worked for me was @tehciolo suggestion of adding a script to package.json, even with the latest version. |
v3.0.6 is not working for me, either. I used the john doe example json with the following commands:
Some system info:
Let me know if there is something I can test or in case more information is needed. (And thanks for this nice project!) |
Hello @dynobo, please note that as discussed, themes should be installed in the local context. Please try it: $ npm install -g resume-cli
$ npm install jsonresume-theme-even
$ resume export resume.html --theme even --resume resume.json |
Thanks for the info, @davcd. Sorry, that I missed that information. $ resume export resume.html --theme even --resume resume.json
Done! Find your new .html resume at:
/home/dynobo/Code/resume/resume.html
$ resume export resume.pdf --theme even --resume resume.json
You have to install this theme relative to the folder to use it e.g. `npm install /home/dynobo/Code/resume/node_modules/jsonresume-theme-even/index.js |
For what it's worth, I now get the error above for pdf ^ without specifying |
@rbardini @antialias Any ideas? If a contributor were to attempt to fix this in a PR, where should they look? |
Jk, as soon as I started looking at code I figured at least part of it out. Here is a PR to potentially fix this issue: #689 Testing locally it fixes PDF generation. I admittedly never had issues with HTML generation (as long as the themes themselves were fully built). In my case I have these scripts:
My problem was that just because I was doing |
v3.0.7 got still the same problem
it shows here
|
Wait I might be missing something, but considering this has been an issue for well over a year, what's the point of this whole JSON Resume project if you can't use a theme and therefore can't export to PDF? |
Looks like the problem is between resume-cli and jsonresume-theme-even. (and potentially other themes) More specifically, resume-cli currently assumes that themes are always exported from an A possible fix could be requiring the "bare" theme specifier when it's not a local theme: if (theme[0] === '.') {
theme = path.join(process.cwd(), 'index.js');
theme = path.join(process.cwd(), theme, 'index.js');
- } else {
- theme = path.join(process.cwd(), 'node_modules', theme, 'index.js');
}
try {
const themePkg = require(theme); so that Node.js resolves the correct file based on the required module's Of course this change could break something else, as has been happening throughout this issue. I highly recommend anyone facing this to give Resumed a try, since one of its main benefits compared to resume-cli is the improved theme resolution. |
After multiple workarounds for other steps (like the pupeteer installation) still I'm not able to generate PDF's out of a valid resume (html works with themes). I'm getting the same "relative folder theme installation" error as #408 (comment). Resumed doesn't support pdf generation either unfortunately. Remove the PDF generation functionality from the Docs if it's not working please, it will save people a lot of time. |
@nvegater my approach was to make some small edits to an existing theme (kendall) that makes html-to-pdf programs work better. I then made a script to streamline uploading the html file to a page where I can use https://tools.pdf24.org/en/webpage-to-pdf on it (it's the only service I found that has no downsides). If it interests you I can dig up the necessary edits. If it were up to me, I'd update the docs to recommend using PDF24. |
Same issue with the PDF for multiple themes, the HTML export works fine. Thanks for the recommendation @DustinWehr |
I have tried pdf24 as well and it generates very good PDF's but with a few CSS errors. Are those the edits you mean ? If yes, I am very interested :) Thank you for the tips!
|
@nvegater I didn't document the changes, but I believe these are a superset (inclusion of index.js might be unnecessary) of the only files I touched from the directory |
yes, 3.0.5 is worked as expected in pdf generation |
For my case I solved the problem of exporting to html with : |
I don't understand the node/js ecosystem, but I've tried all the 'obvious' things and none of these work.
I have a file,
resume.json
, that I would like to export with a theme, sayonepage
. I try this:I run the command and then try to use the downloaded theme:
I've also tried installing things globally, as well as copying my
resume.json
tonode_modules/jsonresume-theme-onepage
and exporting from there, but with no luck.I wasn't able to find docs on how this process is supposed to work...can somebody point me to some docs or tell me what I'm doing wrong?
FWIW I'm on macOS 10.15.4.
The text was updated successfully, but these errors were encountered: