Format text as code in Discord

Author: John Pratt
Date Of Creation: 15 April 2021
Update Date: 1 July 2024
Anonim
Discord Markdown 101 | Text Formatting & Syntax Guide
Video: Discord Markdown 101 | Text Formatting & Syntax Guide

Content

One thing that sets Discord apart from other instant messaging platforms is the use of text formatting. In Discord you can format text in many ways, but it is particularly useful for developers that you can also format text as code.

To step

Method 1 of 2: Line display code

  1. Use line display code if you're using Discord to share a code sample that consists of a line. For example, if you define a variable in php, it can be set to take up less space by using line display code blocks.
  2. Type a grave accent (`).
    • Unlike block codes, highlighting cannot be used with one-line code. You can use blocks of code for a single line of code if you want to emphasize text.
  3. Write your code. Paste or write your code in Discord.
  4. Close the code. Type a grave accent (`) again, ending the code.
  5. Send your message. Your post will now show a block of code in Discord.

Method 2 of 2: Block display code

  1. Use the code for a block representation when your code spans multiple lines. Here you use a standard code for the end of the line, instead of text flow.
  2. Type a grave accent (`) three times. A grave accent indicates in Discord that everything after it is code, up to the next grave accent. This symbol can be found on your keyboard above the Tab ↹, and below the key Esc.
    • If you want to use formatting specific to a particular programming language, place the name of the programming language in lowercase immediately after the third accent grave. Discord has several programming languages, including (but not limited to):
      • markdown
      • ruby
      • php
      • perl
      • python
      • C.S.S
      • json
      • javascript
      • Java
      • cpp - C ++
  3. Write your code. Paste or write your code in Discord, using Shift to start a new line.
    • Discord may recognize that you are typing in a block view and insert line breaks when you press Enter (causing ⇧ Shift is no longer needed), but it may not be on every device or version of Discord.
  4. Enter the code. Type a grave accent (`) three times again to end the code.
  5. Send your message. Your post will now show a block of code in Discord.