Live data from Hacker News

Show HN: Ray.so – Create images of your code

ray.so

61–70 of 129 posts

Re: Show HN: Ray.so – Create images of your code

#62

If you're looking for this, but with an API, I built https://sourcecodeshots.com to power syntax highlighting and Open Graph images of code for https://essay.dev . I initially used carbon.now.sh, but they don't have an API, and the community-provided API is pretty slow because it uses a headless browser to generate the image. Source Code Shots uses VSCode's syntax-highlighting engine, so the highlighting is about as…

This is pretty cool but I notice the default R fibonacci code is like comically non-idiomatic (or poorly linted, even).

Since I suspect the cause here is copy-pasting off of an algorithms/code gallery, my guess is that there are examples across other languages. I checked everything I feel idiomatically comfortable enough and the others all seemed fine, but there are a lot of options here so who knows.

Re: Show HN: Ray.so – Create images of your code

#65
post #28

Earlier quoted context omitted.

Yeah, we wanted to add an API at some point and also provide a deeper integration with Raycast. What would you like to build with the API?

Say I have code snippets I want to include in a Jekyll blog for example. I could call your API from a pipeline process, store the images and link them from the posts. A plugin would be deeper integration, but an API would just work and would be great already. I guess a similar process could work for other blogging platforms.

Wouldn't this make the code snippets completely inaccessible since you cannot copy text from an image?

Re: Show HN: Ray.so – Create images of your code

#66

If you're looking for this, but with an API, I built https://sourcecodeshots.com to power syntax highlighting and Open Graph images of code for https://essay.dev . I initially used carbon.now.sh, but they don't have an API, and the community-provided API is pretty slow because it uses a headless browser to generate the image. Source Code Shots uses VSCode's syntax-highlighting engine, so the highlighting is about as…

This is pretty cool but I notice the default R fibonacci code is like comically non-idiomatic (or poorly linted, even). Since I suspect the cause here is copy-pasting off of an algorithms/code gallery, my guess is that there are examples across other languages. I checked everything I feel idiomatically comfortable enough and the others all seemed fine, but there are a lot of options here so who knows.

If you have a good recursive version of Fibonacci for R, I'd love to swap it out for what I currently have.

For the languages I don't know, I looked at the code people posted on rosettacode.org

Re: Show HN: Ray.so – Create images of your code

#67
Not trying to be argumentative but this is completely over my head and I do not understand the purpose.

Is there some way to get a CSS snippet out for publishing in a blog/article/presentation or is it only images?

edit: is this purely to add a rounded border/pad that you wouldn't get with WND+SHIFT+S / CMD+SHIFT+4 for sharing on sites where you don't control the style?

Re: Show HN: Ray.so – Create images of your code

#68

I may be rather opinionated on this, but there are literally community efforts to transcribe memes and other pictures containing text so visually impaired people get access to content, and meanwhile about every 3-4 weeks HN features yet another web app that basically takes human readable text and stores it in one of the most inefficient and inaccessible ways possible. It becomes invisible to screenreaders, impossible…

Some people love the text from an aesthetic view. I don't think we should be against that but rather to advocate the improvement of accessible technology.

We have great accessible technology for colored text with background images.

Re: Show HN: Ray.so – Create images of your code

#69
post #65
post #28

Earlier quoted context omitted.

Say I have code snippets I want to include in a Jekyll blog for example. I could call your API from a pipeline process, store the images and link them from the posts. A plugin would be deeper integration, but an API would just work and would be great already. I guess a similar process could work for other blogging platforms.

Wouldn't this make the code snippets completely inaccessible since you cannot copy text from an image?

Indeed, but I'd link the GitHub code sources below each picture and provide good alt descriptions. JS plugins like Highlight or Prism end up building massive HTML making e.g. google's pagespeed tools complain about DOM sizes.

And, anyway, most people would rather clone the public repo or use GitHub for copy/paste purposes.

Post reply on HN