Earlier quoted context omitted.
I built this to generate PNGs to drop into a Keynote presentation, so PDFs don't quite work for my use case. It seems like it should be pretty easy to print a PDF from Puppeteer though – they expose a #pdf method. https://github.com/GoogleChrome/puppeteer/blob/master/docs/a...
Just curious why you'd want to use code screenshots vs text in a presentation. Did it have to do with missing fonts or something like that?
Show HN: Generate high-res images of code samples with Chrome Headless
11–20 of 92 posts
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#12Hmm. I would just usually screenshot the code snippet in my IDE. Seems like an easier solution. However, congrats on assembling your "Lovecraftian amalgamation of software." :)
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#13Why "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.
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
#14Earlier quoted context omitted.
Just curious why you'd want to use code screenshots vs text in a presentation. Did it have to do with missing fonts or something like that?
Not OP, but syntax highlighting and other niceties are probably going to disappear within most presentation software.
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#15Re: Show HN: Generate high-res images of code samples with Chrome Headless
#16Wouldn't it be better as a PDF so that it can be selected? But somehow still retain the color / formatting.
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#17In my case, I use an Alfred workflow that formats the code snippet and then I can just paste the formatted code into Keynote/Powerpoint. It supports several color themes and it's super fast https://github.com/importre/alfred-hl
Re: Show HN: Generate high-res images of code samples with Chrome Headless
#18Nice 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
#19What happened to the simple screenshot?
This seems to be the flow:
+----------+ +----------+ +-------------+
| | | | | |
| NodeJS +------->+ POI +--------->+ Puppeteer +----+
| | | | | | |
+----------+ +----------+ +-------------+ |
|
|
+----------+ +----------+ +-------------+ |
| | | | | | |
| NodeJS
* drawn with http://asciiflow.com/