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

General Discussion

Posting code in the forum

How do I post code in the forum. Every time I try to help answer someone's question my code doesn't post. Make it's difficult to answer questions.

4 Answers

If you check in the Markdown Cheatsheet link below the comment window it shows how; there's a small sample of text that shows exactly how to do it.

Make sure you put the three backticks on separate lines above and below your code or it doesn't work right, which I spent a while figuring out a few hours ago.

Also, if you put the language of the code on the same line as the opening backticks. It will color code the format accordingly.

with js (.js, javascript, filename.js also work) after the three backticks

function () {
  var test = new Test();
}

nothing after the three backticks

function () {
  var test = new Test();
}
Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Melissa;

You can also take a look at this post for a good overview of the process.

Happy coding,

Ken

Hey,

The forum uses markdown for showing code!

"```language_name_goes_here ```" 

Ignore the double quotes.

It starts with three double ticks and ends with three back ticks.

.

Hey Melissa,

Here is a link to explain how to use Markdown to post your code How to post code

If you look at the bottom of the box when your typing a reply you will see Markdown Cheatsheet that will also explain how to post your code.