Show HN: Generate high-res images of code samples with Chrome Headless
31–40 of 92 posts
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#32Anyone knows a tool which can help us draw simple diagrams like the one that was mentioned in the README?? https://github.com/mplewis/src2png/blob/master/docs/foreach_...
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#33What'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.
Just fwiw, apparently (i.e., I discovered in the last 10 mins) pygmentize detects file extensions, so
$ pygmentize -o test.png test.py
is equivalent.Re: Show HN: Generate high-res images of code samples with Chrome Headless
#34Nice work. But I'm not looking forward to trying to select text only to drag an image
Thanks! I built this for Keynote presentations specifically. I wanted to be able to write code samples as snippet files, then generate a batch of images I can drop into my presentations. If you're posting code on a website, you're right – you should prefer and prism.js or highlight.js :)
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#35Re: Show HN: Generate high-res images of code samples with Chrome Headless
#36Re: Show HN: Generate high-res images of code samples with Chrome Headless
#37Anyone knows a tool which can help us draw simple diagrams like the one that was mentioned in the README?? https://github.com/mplewis/src2png/blob/master/docs/foreach_...
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#38Why "Show HN" but not publish to NPM? Seems neat, just publish it. Also, ever try this technique? https://gist.github.com/jimbojsb/1630790 I've used it with success before.
Thank you! I don't want to publish it yet because I want to clean it up a lot first – ditch the dev server, clean up the build pipeline, add some actual CLI arguments, etc. I'll check out that app on brew, it looks like a cool approach. Thanks!
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#39 Oh god, this is horrifying. You have built a monster and it is made of JavaScript.
Yes it is. Yes I have.Re: Show HN: Generate high-res images of code samples with Chrome Headless
#40If 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…
The next step is to start a virtual machine to run NodeJS to "improve" on this workflow.