Skip to content

Commit adbacb8

Browse files
committed
Add details to the Markdown section
I've reorganized the markdown section and added more details about its usage in embeds as well as a new part about spoilers and quotes.
1 parent 0e2f556 commit adbacb8

File tree

1 file changed

+115
-21
lines changed

1 file changed

+115
-21
lines changed

docs/getting-started/more-features.mdx

Lines changed: 115 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,122 @@ 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+
```
286+
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.
289+
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+
```
279297

280-
Code Blocks support different programming languages, such as Python.
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.
281300

282-
If you start your Code Block with <code>```python</code>, you can send readable Python code to Discord.
301+
```
302+
>>> This is a
303+
multi-line quote.
304+
```
305+
306+
#### Spoiler Markdown
307+
308+
To hide a spoiler, encase the text between double pipes. The users
309+
will have to click on it before being able to see the text contained in it.
310+
311+
```
312+
||spoiler||
313+
```
314+
315+
#### Link Markdown
316+
317+
Link formatting only works in embeds and messages sent through webhooks,
318+
by using the following syntax:
319+
320+
```
321+
[Pycord](https://pycord.dev/)
322+
```
323+
324+
Inside the supported elements that have just been mentioned,
325+
the example above will look like this: [`Pycord`](https://pycord.dev/)
326+
327+
Outside of them, the link will still be clickable but the formatting will be ignored,
328+
therefore the example above will look similarly to this: `[Pycord](https://pycord.dev/)`
329+
330+
#### Embed Markdown
331+
332+
Adding markdown to your embeds or messages will give your bot the sparkle it needs,
333+
however, markdown is limited inside embeds. Use the following table as a reference
334+
and keep in mind that embed title and filed names will always show in **bold**.
335+
336+
<table>
337+
<thead>
338+
<tr>
339+
<th>Part</th>
340+
<th>Text</th>
341+
<th>Link</th>
342+
</tr>
343+
</thead>
344+
<tbody>
345+
<tr>
346+
<td>Embed Author</td>
347+
<td>No</td>
348+
<td>No</td>
349+
</tr>
350+
<tr>
351+
<td>Embed Title</td>
352+
<td>Yes</td>
353+
<td>No</td>
354+
</tr>
355+
<tr>
356+
<td>Embed Description</td>
357+
<td>Yes</td>
358+
<td>Yes</td>
359+
</tr>
360+
<tr>
361+
<td>Field Name</td>
362+
<td>Yes</td>
363+
<td>No</td>
364+
</tr>
365+
<tr>
366+
<td>Field Value</td>
367+
<td>Yes</td>
368+
<td>Yes</td>
369+
</tr>
370+
<tr>
371+
<td>Embed Footer</td>
372+
<td>No</td>
373+
<td>No</td>
374+
</tr>
375+
</tbody>
376+
</table>

0 commit comments

Comments
 (0)