Skip to content

Commit 4d30a1a

Browse files
committed
Add details to the Markdown section
I've reorganized the markdown section and added more details about its usage in embeds.
1 parent 0e2f556 commit 4d30a1a

File tree

1 file changed

+106
-21
lines changed

1 file changed

+106
-21
lines changed

docs/getting-started/more-features.mdx

Lines changed: 106 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ method, you can set a small footer that holds a message. This has `text` and `ic
218218
- Author - With the [`set_author`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_author)
219219
method, you can set an author for the embed. This is a small text field at the top of the embed. This
220220
includes `name`, `url` and `icon_url` kwargs.
221-
- Thumbnail - With the [`set_thumbnial`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_thumbnail)
221+
- Thumbnail - With the [`set_thumbnail`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_thumbnail)
222222
method, you can set a small image to reside at the top-right of the embed. This has a single `url` kwarg.
223223
- Image - With the [`set_image`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_image)
224224
method, you can set an image to sit at the bottom of an embed. This has a single `url` kwarg.
@@ -227,7 +227,12 @@ There are a lot more methods and attributes you can use to configure embeds. Her
227227

228228
### Markdown
229229
Markdown is a type of markup language that's limited in terms of formatting yet simple. Discord allows
230-
for a watered-down version of markdown to be in their messages. This includes:
230+
for a watered-down version of markdown to be in their messages.
231+
232+
#### Text Markdown
233+
234+
Text formatting can be used in messages and in most embed parts,
235+
as explained in the dedicated section below.
231236

232237
<table>
233238
<tr>
@@ -250,33 +255,113 @@ for a watered-down version of markdown to be in their messages. This includes:
250255
</tr>
251256
</table>
252257

253-
Sadly, Discord does not support other types, such as hyperlinks. The only supported places for hyperlinks are
254-
in embeds and messages sent through webhooks.
255-
256-
Adding markdown to your embeds or messages will give your bot the sparkle it needs.
258+
#### Code Markdown
257259

258-
Here is an example for a hyperlink in embeds.
260+
To create a single-line code block without syntax highlight, wrap the text between single backticks.
261+
This code block will only add a dark background to the text.
259262

260263
```
261-
[Click here!](https://pycord.dev/)
264+
\`print("Hello world!")\`
262265
```
263-
Inside the embed, the example above will look like this: [`Click here!`](https://pycord.dev/)
264266

265-
:::caution
266-
267-
Some embed fields, such as the footer, do not support markdown *at all*, including bold and italics.
268-
269-
:::
267+
To create a multi-line code block without syntax highlight, wrap the text between triple backticks
268+
on first and last line. This type of code block will encase the code inside a box.
270269

271-
#### Code Markdown
270+
```
271+
\`\`\`
272+
message = "Hello world!"
273+
print(message)
274+
\`\`\`
275+
```
272276

273-
For code markdown, you can choose between `Code Text` and `Code Blocks`.
277+
To create a multi-line block with syntax highlight, add the name of the language you are using right after
278+
the triple backticks on the first line. For example, for Python you can write either "python" or "py".
274279

275-
- \`Code Text\`
276-
- \`\`\`
277-
Code Blocks
280+
```
281+
\`\`\`python
282+
message = "Hello world!"
283+
print(message)
278284
\`\`\`
285+
```
279286

280-
Code Blocks support different programming languages, such as Python.
287+
If you want to use syntax highlight for a single line of code, you still have to format it
288+
like a multi-line block but the code must be on a separate line than the triple backticks.
281289

282-
If you start your Code Block with <code>```python</code>, you can send readable Python code to Discord.
290+
#### Quote Markdown
291+
292+
To create a single-line quote block, start the line with `>` followed by a space.
293+
294+
```
295+
> This is a single-line quote.
296+
```
297+
298+
To create a multi-line quote block, write `>>>` followed by a space. All text
299+
from that point onwards will be included in that quote block.
300+
301+
```
302+
>>> This is a
303+
multi-line quote.
304+
```
305+
306+
#### Link Markdown
307+
308+
Link formatting only works in embeds and messages sent through webhooks,
309+
by using the following syntax:
310+
311+
```
312+
[Pycord](https://pycord.dev/)
313+
```
314+
315+
Inside the supported elements that have just been mentioned,
316+
the example above will look like this: [`Pycord`](https://pycord.dev/)
317+
318+
Outside of them, the link will still be clickable but the formatting will be ignored,
319+
therefore the example above will look similarly to this: `[Pycord](https://pycord.dev/)`
320+
321+
#### Embed Markdown
322+
323+
Adding markdown to your embeds or messages will give your bot the sparkle it needs,
324+
however, markdown is limited inside embeds. Use the following table as a reference
325+
and keep in mind that embed title and filed names will always show in **bold**.
326+
327+
<table>
328+
<thead>
329+
<tr>
330+
<th>Part</th>
331+
<th>Text</th>
332+
<th>Link</th>
333+
</tr>
334+
</thead>
335+
<tbody>
336+
<tr>
337+
<td>Embed Author</td>
338+
<td>No</td>
339+
<td>No</td>
340+
</tr>
341+
<tr>
342+
<td>Embed Title</td>
343+
<td>Yes</td>
344+
<td>No</td>
345+
</tr>
346+
<tr>
347+
<td>Embed Description</td>
348+
<td>Yes</td>
349+
<td>Yes</td>
350+
</tr>
351+
<tr>
352+
<td>Field Name</td>
353+
<td>Yes</td>
354+
<td>No</td>
355+
</tr>
356+
<tr>
357+
<td>Field Value</td>
358+
<td>Yes</td>
359+
<td>Yes</td>
360+
</tr>
361+
<tr>
362+
<td>Embed Footer</td>
363+
<td>No</td>
364+
<td>No</td>
365+
</tr>
366+
</tbody>
367+
</table>

0 commit comments

Comments
 (0)