How to Format Code in Gitter - Women Who Code.
Resources for women who code
women who code, girls who code, ladies who code
post-template-default,single,single-post,postid-52000,single-format-standard,qode-core-1.0.1,ajax_fade,page_not_loaded,,capri child-child-ver-1.0.0,capri-ver-1.6, vertical_menu_with_scroll,smooth_scroll,grid_1200,blog_installed,wpb-js-composer js-comp-ver-4.12.1,vc_responsive

How to Format Code in Gitter

How to Format Code in Gitter

If you are a developer who uses Gitter chat and shares code in chatrooms like FreeCodeCamp, you often need to format your code as you post. Let’s look at Gitter markdown code formatting basics, that helps to make code readable.

How to post correctly formatted code in Gitter

The idea is to use backticks and new lines to place your code between them. Use triple backticks for multiline code and single ones for a single line of code.

How to format Multi Line code in Gitter:

  1. Type 3 backticks in a row
  2. Press [shift + enter ⏎] to add a new line
  3. Paste your code
  4. Press [shift + enter ⏎] to add a new line
  5. Type 3 backticks in a row
  6. Press [ctrl + enter ⏎] to post or shift + enter to get the new line and proceed writing comments or paste another piece of code

To find backtick on your keybord, look in the top right corner, right under the Esc key.
On some keyboards it can be located in the top part of keyboard in thr middle of the digits row.

How to format Single Line code in Gitter:

Same as for the multiline one, but use a single backtick (`) at start and end around the code instead of a triple one.


So to get nicely formatted code in Gitter, we use backticks and new lines in a so called Compose mode. When you type 3 backticks and then alt+enter, it automagically toggles compose mode so you can type in or paste code. When you send the message, compose mode gets toggled back off.

If you can’t use backticks yourself for whatever reason, paste your code here and it will add backticks for you:

Get your backticks!

No Comments

Post a Comment