petersolopov / carbonara Goto Github PK
View Code? Open in Web Editor NEWAPI for carbon
License: MIT License
API for carbon
License: MIT License
I am reading the content of my code files and storing it inside a variable. Then, I am using the variable inside the bash script to create a preview with the code.
However, as I am manually executing the bash script from inside of my script, specific characters included in my code files are hindering the bash script to execute/complete. This is resulting in corrupted, unopenable .png files.
And sometimes, characters in the file name are prohibiting the bash script from executing. Spaces in the name caused this issue. I believe numbers also were a problem. I am not exactly sure.
The temporary solution I came up with is to use lookalike Unicode characters. However, this causes another issue, as the API cannot interpret the characters to mean what they are supposed to mean, and the coloring is ruined.
Therefore, I am currently left with a script that succeeds 50% of the time yet still produces wrong previews.
The specific characters that causes issues for me are:
If I had found all of the characters, my script would be executing with a higher successful rate. As I am not educated about using bash, I was unable to identify the additional characters that were causing issues.
In addition, as I am reading the content of my code, the actual typed out newlines '\n
' are getting mixed up with the interpreted newlines (actually pressing enter).
Hi, I'm trying to test this API in postman by sending a post request on /api/cook with the required body but its returning me Error code 500: A server error has occurred FUNCTION_INVOCATION_FAILED
Error:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Application Error</title>
<style media="screen">
html,body,iframe {
margin: 0;
padding: 0;
}
html,body {
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: 0;
}
</style>
</head>
<body>
<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
</body>
</html>
as the title said i need the value of carbon ImageSelector in your env
Hi there, great work on the API, I'm liking it so far!
I would like to deploy it on the PaaS Caprover, which is built on Docker Swarm. Your documentation however asks me to use the --cap-add=SYS_ADMIN
flag, but that is is completely unsupported on swarm. Is there a way to modify your dockerfile not to rely on that being available? If you could just tell me which steps it is required for maybe I could patch it myself :)
Hi there,
I'd like to see transparent background to be implemented, It is possible if i set alpha to 0 in the rgba option, but I don't think puppeteer takes transparent screenshots.
Thanks,
cosmicice
This API call takes around 15 to 20 seconds, but i am trying to use this via Vercel Server which has limit of 10 seconds timeout, this Request is so slow is there any improvement for this ?
Thanks.
I try to run it on my server but it report a error when I send a post request, which don't happen if use https://carbonara.now.sh/
(node:17) UnhandledPromiseRejectionWarning: TimeoutError: Navigation timeout of 30000 ms exceeded
at /home/pptruser/app/node_modules/puppeteer-core/lib/LifecycleWatcher.js:100:25
-- ASYNC --
at Frame.<anonymous> (/home/pptruser/app/node_modules/puppeteer-core/lib/helper.js:82:19)
at Page.goto (/home/pptruser/app/node_modules/puppeteer-core/lib/Page.js:440:53)
at Page.<anonymous> (/home/pptruser/app/node_modules/puppeteer-core/lib/helper.js:83:27)
at module.exports (/home/pptruser/app/src/takeScreenshot.js:41:14)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:17) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I 'm not familiar with node.js, so I search it in google. But I can't solve it. I wish if someone can help me.
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.