Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,520 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.