Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

21st Century Skills

Doug Devitre
Doug Devitre
16,516 Points

Adding code snippets into Treehouse responses (and web pages)

I've noticed in responses to Treehouse forum responses, users are able to insert code snippets in addition to the text that describes and supports their responses.

I've also noticed in developer docs and blog posts that authors can create these code snippet widgets that allow for a quick copy and paste of the precise characters.

What are a few ways where you have posted code snippets that make it easier for another developer to use your code suggestions online?

I'm looking for a shortcode, a snippet widget, or some sort of plugin that supports this option to post code online.

2 Answers

Steven Parker
Steven Parker
231,275 Points

The code is inserted in the post using Markdown formatting. For more complex code, you can create a workspace "snapshot" and provide a link to it. Here are some resources you might find helpful:

Doug Devitre
Doug Devitre
16,516 Points

I've always wondered how to do that and this will be extremely helpful in so many ways. Gracias Steven Parker :)