While one of the most lopsided discussions on Discord may be the choice between Dark and Light themes, color-based customization doesn’t go far beyond that choice and setting custom role colors.
Discord does support markdown, however. If you’re unfamiliar with markdown, this is a simple character-based formatting that you apply to messages to add effects such as bold and italic.
Of all the markdowns Discord supports, code blocks may be the most versatile. You don’t need to be a programmer to use code blocks, and many users are unaware that these blocks actually allow users to add color to their text.
Embarrassed? In this article, let’s talk about code blocks and how you can use them to create colored Discord posts.
What are blocks of code on discord?
Blocks of code, sometimes referred to as code blocks or just blocks, are a form of markdown supported by Discord’s rendering engine.
If you don’t know what markdown is, some of the more commonly used tricks are to enclose text with single asterisks (* like here *) for italicizing text, or double asterisks (** like this **) for bold text.
Discord supports markdowns for these, as well as underscores (__ like this__), strikethrough (~~ like this ~~), spoiler tags (|| like this ||), quotes (> like this), and one-line code blocks (`like this `).
However, along with single-line code blocks, Discord also supports multi-line code blocks. The one-line code block adds a dark background to white, monospaced text, making it easy for Discord users to share short snippets of code in a readable format. Multi-line code blocks allow users to share more complex code that spans multiple lines.
To create a multi-line block of code, enclose the text in triple back quotes (â€œlike thisâ€). It will create a large dark frame around your text, format it with a monospaced font, and keep all the padding.
One thing that really sets multi-line blocks of code apart from other markdowns is that they support syntax highlighting.
What is meant by highlighting syntax in code blocks when in dispute?
Syntax highlighting is a feature commonly found in text editors and Notepad alternatives such as Notepad ++ and Sublime Text. It allows coders to define the programming language of a document so that important code elements are colored for easy reading and understanding.
Since Discord’s multi-line block of code markup is intended for this purpose, there are clever ways you can use it to add color to your posts.
To add syntax highlighting to multiline code blocks, you must enter the keyword after the first set of triple back quotes. Here’s an example:
Written as a post on Discord, it will look like this: Knowing which formatting styles make which colors stand out can be done in the dark unless you have a tutorial covering them all, which we do.
Discord code syntax highlighting styles
Written as a post on Discord, it will look like this:
Knowing which formatting styles make which colors stand out can be done in the dark unless you have a tutorial covering them all, which we do.
Below is a list of all the known syntax highlighting keywords that Discord’s multiline code block markup supports.
Over time, Discord may continue to add new syntax highlighting options.
While using Discord syntax highlighting might not be as clean an implementation as being able to simply change the color of the text, it is still very useful and the best solution available right now for creating colored Discord posts.
There are many options, so if you ever have a large chunk of text that you need to format for easier reading – like a list of commands for your Discord music bot – be sure to try code blocks.