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

Samuel Focht
Samuel Focht
4,321 Points

Posting

How do I post a figure while answering someones question. I posted one a minute ago and I didn't see a place to paste the code so it would look formatted. Right now it is text.

Thanks, Sam

2 Answers

Hey Sam,

posting code is simple. you can view the "Markdown Cheatsheet" under comment/answer text boxes or you can follow the gif below.

I hope this helps.

andren
andren
28,558 Points

By figure do you mean a code box like this?

String example = "Hello World"!;

If so that there isn't any box you paste your code into, you have to add some formatting for it manually around your code. If you click on the "Markdown Cheatsheet" link below your text window you will see a window that explains how to perform various kind of formatting on your text. One of those describes how to format code. I'll quote it in this post to save you some trouble:

Code

Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

     ```html
     <p>This is code!</p>
     ```

So just add three backticks before and after your code (on their own lines) and add the name of the language right after the beginning backticks and then you will get proper formatting and highlighting.