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

Config does not load #77

Closed
BoKKeR opened this issue May 1, 2022 · 1 comment
Closed

Config does not load #77

BoKKeR opened this issue May 1, 2022 · 1 comment

Comments

@BoKKeR
Copy link

BoKKeR commented May 1, 2022

I am running the following

./node_modules/.bin/carbon-now --headless --config carbon-config.json src/doc/help.md -t help -l img

with

{
  "paddingVertical": "56px",
  "paddingHorizontal": "56px",
  "backgroundImage": null,
  "backgroundImageSelection": null,
  "backgroundMode": "color",
  "backgroundColor": "rgba(74,144,226,1)",
  "dropShadow": true,
  "dropShadowOffsetY": "20px",
  "dropShadowBlurRadius": "68px",
  "theme": "verminal",
  "windowTheme": "none",
  "language": "markdown",
  "fontFamily": "Hack",
  "fontSize": "14px",
  "lineHeight": "133%",
  "windowControls": true,
  "widthAdjustment": false,
  "lineNumbers": false,
  "firstLineNumber": 1,
  "exportSize": "2x",
  "watermark": false,
  "squaredImage": false,
  "hiddenCharacters": false,
  "name": "",
  "width": 702
}

And the result it
help

While the same config on the website gives:

image

Is there something I am missing? I have the config in the folder I am running the command from. I also tried with global carbon-now

@mixn mixn mentioned this issue Feb 6, 2023
26 tasks
@mixn
Copy link
Owner

mixn commented Apr 15, 2023

@BoKKeR I’m almost done with the large v2 rewrite and have started looking at open issues.

The config you’re using might be valid on Carbon itself, but the format for presets in the CLI is different. Take a look at the default settings here.

The CLI uses Carbon’s query string param names (e.g., ds instead of dropShadow, fs instead of fontSize, etc.), so I don’t have to convert between fitting objects all the time. Also, you’re not specifying an existing preset in your example above; it’s lacking --preset.

I’ve tried what you were trying to do with a fresh install and an existing folder structure (the repo itself) + a custom --config, and everything works as expected.

npm uninstall -g carbon-now-cli
npm i -g carbon-now-cli
git clone https://github.com/mixn/carbon-now-cli.git
cd carbon-now-cli
carbon-now ./test/test-dummies/_unfold.js --config ./test/test-dummies/_config.json -p dummy-preset -t help -l ~/Desktop

results in ~/Desktop/help.png, which looks as expected (applying the dummy-preset):

help

Let me know if I’m missing something here. 🙂

@mixn mixn closed this as completed Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants