DEV Community

Giuseppe Vetri
Giuseppe Vetri

Posted on

 

Do you prefer a Github Gist or Markdown code snippet in a post?

When using the dev.to night theme (Which is my favorite), I prefer the Markdown code Snippet because it's dark and doesn't burn my eyes.
Burned

But in the other hands if the publisher is cross-posting and use a Github Gist and modify that in one place and see that change reflected in multiple sites is an excellent advantage for the one who publishes the Gist.

What are your thoughts about it?

Top comments (3)

Collapse
 
smartcodinghub profile image
Oscar • Edited

I always prefer snippets, as I easily see the code and the explanation about it together without context change (change tabs vs just a bit of scroll). But if the snippet is too long, I like a gist/repo.

EDIT: Also, you are writting for other, so you want to make it easy for them to read it. And only then you want to make it easy for you to update your content (something that occurs way less times). It seems like a premature microptimization ;)

Collapse
 
gvetri profile image
Giuseppe Vetri

That's a great perspective!. I was writing some post and thought about it. I think it is a micro-optimization. ­čśë

Collapse
 
kaylumah profile image
Max Hamulyák

I am sorry to see you did not get more responses to this question, since its the exact problem I am facing.

I cross post from my custom domain to dev.to and medium via RSS feed. This mostly works for dev.to (sometimes a few code-language tags missing) but updating it for medium is a lot more work. Since tables, images, and code snippets will break.

I personally prefer just the markdown snippets since it will honour user settings (like dark mode), but am considering the use of GitHub gists to make the experience on Medium better.

Since Markdown supports any html tag I am considering posting <!-- --> tags with the gist link in markdown as a trigger to update them as well.

Like to hear more about your experiences.

Regex for lazy developers

regex for lazy devs

You know who you are. Sorry for the callout ­čść