# \[How to\] Post correctly formatted and colorized code on the forum?

**URL:** <https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189>\
**Category:** Developers\
**Tags:** colourize, colorize\
**Created:** [June 7, 2017, 12:38pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189 "2017-06-07T12:38:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [June 7, 2017, 12:38pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/1 "2017-06-07T12:38:08Z")

</div>

Continuing the discussion from [Ruby backtick returns nothing!](https://forums.sketchup.com/t/ruby-backtick-returns-nothing/46120/17):

> [@Getting unique ID of a user's machine](https://forums.sketchup.com/t/getting-unique-id-of-a-users-machine/46120/17):
>
> How do you colourize your code on the forum?

Triple **backtick** delimiter lines.

- [What is a backquote ?](https://www.computerhope.com/jargon/b/backquot.htm)

* * *

> - ![image](https://global.discourse-cdn.com/sketchup/original/3X/8/a/8a98903caded9bf8886a8056bec29f491829603d.jpeg)
> 
> Backquote character key on US keyboard.

* * *

If it is **error message text** (or some other plain text that contains `<`, `>`, `#`, or other characters that can confuse Discourse markdown,) then specify “ **text** ” as a lexing language:

> ```text  
> ` paste error message here`  
> ```

If it is **Ruby** , then:

> ```ruby  
> ` # code here`  
> ```

If it is **Javascript** , then:

> ```javascript  
> `/* js code here */`  
> ```

If it is **HTML** , then:

> ```html  
> ` <!-- html here -->`  
> ```

If it is **C** , then:

> ```c  
> `// C code here `  
> ```

**_… etc._** (Discourse code lexer recognizes the major programming languages.)

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [June 7, 2017, 12:50pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/2 "2017-06-07T12:50:21Z")

</div>

```ruby
# Test
module Eneroth3::TestSyntaxHighlight
  def self.method_name
    puts "String"
    5+12
    yield false
    return true
  end
end

```

I had no idea this forum supported syntax highlighting 😮 .

---

<div class="post-metadata">

**Author:** ![slbaumgartner](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/slbaumgartner/32/7302_2.png) [@slbaumgartner](https://forums.sketchup.com/u/slbaumgartner)\
**Post date:** [June 7, 2017, 1:44pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/3 "2017-06-07T13:44:02Z")

</div>

> [@eneroth3](#):
>
> I had no idea this forum supported syntax highlighting 😮 .

Yep! Discourse processes your post’s text through a Markdown language formatter, and implements this feature of Markdown. The Markdown formatter is also why posts of error messages and code can get so screwed up if people don’t use the triple backtick syntax!

---

<div class="post-metadata">

**Author:** ![jody](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jody/32/227_2.png) [@jody](https://forums.sketchup.com/u/jody)\
**Post date:** [July 6, 2017, 4:24pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/4 "2017-07-06T16:24:58Z")

</div>



---

<div class="post-metadata">

**Author:** ![Caroline](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/caroline/32/37338_2.png) [@Caroline](https://forums.sketchup.com/u/Caroline)\
**Post date:** [January 15, 2018, 4:55pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/6 "2018-01-15T16:55:41Z")

</div>



---

<div class="post-metadata">

**Author:** ![Caroline](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/caroline/32/37338_2.png) [@Caroline](https://forums.sketchup.com/u/Caroline)\
**Post date:** [January 25, 2018, 11:58pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/7 "2018-01-25T23:58:42Z")

</div>



---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [April 4, 2018, 3:47pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/9 "2018-04-04T15:47:04Z")

</div>

> [@ketchum.prod](#):
>
> markdown what is it

Welcome Dylan … the wikipedia page (linked below) explains what markdown is in detail.

But it is basically a simple, human-readable text code that can be used to nicely format posting on the web or documents.

The forum system should have sent you a message explaining the basics of using markdown on the forum.  
(Click your avatar menu at the top right, see if the welcome message from the system is there.)

> **[Markdown](https://en.wikipedia.org/wiki/Markdown)**
>
> Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as a markup language that is easy to read in its source code form. Markdown is widely used for blogging and instant messaging, and also used elsewhere in online forums, collaborative software, documentation pages, and readme files.
> The initial description of Markdown contained ambiguities and raised unanswered questions, causing implementations to both intentional...

---

<div class="post-metadata">

**Author:** ![TheOnlyAaron](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/theonlyaaron/32/9436_2.png) [@TheOnlyAaron](https://forums.sketchup.com/u/TheOnlyAaron)\
**Post date:** [September 11, 2019, 9:31pm UTC](https://forums.sketchup.com/t/how-to-post-correctly-formatted-and-colorized-code-on-the-forum/46189/10 "2019-09-11T21:31:25Z")

</div>


