Markdown formatting
- Last edited on Jul 3, 2022, 7:01:46 AM by Antti Haapala -- Слава Україні
- Edit
Markdown is used in Stack Overflow for formatting text in both Q+As and chat. This page is a set of examples showing how markdown can be used to produce various effects. The examples are aimed more at chat than the main site, but should be applicable to both.
Text formatting
Text can be formatted in a variety of ways, some basic formatting includes:
- Bold text –
**Bold text**
or__Bold text__
(N.B.: double underscore) - Italic text –
*Italic text*
or_Italic text_
(N.B.: single underscore) - Bold italic text –
***Bold italic text***
or___Bold italic text___
(N.B.: triple underscore) Strikethrough–---Strikethrough---
Code formatting
See Illustrated Guide to Formatting Code In Chat
When presenting code it is typical to use a monospaced font, this makes it easier to read and distinguises from normal text.
Code can be formatted in-line by using backticks:
- I love the python print function
print()
– I love the python print function `print()`
If your code spans more than one line, you can place it inside a code block by indenting by 4 spaces. Alternatively, you can select your text and press Ctrl+K
to automatically convert the code.
N.B.: In SO chat you cannot have both a text block and a code block in the same “message”, it will fail and everything will appear as text.
Links
Links can be provided inline easily with the following format
- Chat! –
[Chat!](http://chat.stackoverflow.com/rooms/6/python)