Earlier quoted context omitted.
Why not just do a screenshot of the code from Atom?
That doesn't scale well beyond doing a handful of them, I would think.
Show HN: Generate high-res images of code samples with Chrome Headless
51–60 of 92 posts
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#52If I want to scratch my left hear, I would use my left hand. Why in the world I'll do it with my right foot? What happened to the simple screenshot? This seems to be the flow: +----------+ +----------+ +-------------+ | | | | | | | NodeJS +------->+ POI +--------->+ Puppeteer +----+ | | | | | | | +----------+ +----------+ +-------------+ | | | +----------+ +----------+ +-------------+ | | | | | | | | | NodeJS * drawn…
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#53Images of code are the worst . Completely unusable.
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#54Re: Show HN: Generate high-res images of code samples with Chrome Headless
#55Re: Show HN: Generate high-res images of code samples with Chrome Headless
#56If I want to scratch my left hear, I would use my left hand. Why in the world I'll do it with my right foot? What happened to the simple screenshot? This seems to be the flow: +----------+ +----------+ +-------------+ | | | | | | | NodeJS +------->+ POI +--------->+ Puppeteer +----+ | | | | | | | +----------+ +----------+ +-------------+ | | | +----------+ +----------+ +-------------+ | | | | | | | | | NodeJS * drawn…
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#57Re: Show HN: Generate high-res images of code samples with Chrome Headless
#58Earlier quoted context omitted.
The next step is to start a virtual machine to run NodeJS to "improve" on this workflow.
Nah, this is perfect for containers. You could use kubernetes to manage it all.
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#59But for his use case ('presentation') there are tons of presentation libs/franeworks in HTML/JS/CSS which support code embeddings with syntax highlighting.
Same quality but much easier workflow since code stays editable.
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#60What's wrong with pygments? I've been using it to get highlighted code as latex, html, whatever, since forever. I'm all for reinventing deficient wheels, but is there anything wrong with this? pygmentize -f png -l python -o test.png test.py Spinning up a browser for it seems like an odd choice. At least the author acknowledges that.
Hey, thanks for the suggestion. I've used Pygments in the past and didn't even think to check if it had a PNG output mode. Here's an example of Pygments C++ output: http://imgur.com/a/7TbMb And the same file through Prism.js + Puppeteer: https://github.com/mplewis/src2png/blob/master/docs/arduino.... Pygments does a great job of generating detailed PNGs. The default settings aren't quite what I'm looking for, but the…
pygmentize -f rtf -O "fontface=Fira Code,fontsize=26" -l prolog familyinteract.pl | pbcopy
(That was for pasting code into Pages; for Keynote you'll probably want a bigger font size.)