How can I make it so this,
The primary network interface
auto eth1 iface eth1 inet dhcp
looks the same as it appears on the monitor, like this:
# The primary network interface
auto eth1
iface eth1 inet dhcp
How can I make it so this,
auto eth1 iface eth1 inet dhcp
looks the same as it appears on the monitor, like this:
# The primary network interface
auto eth1
iface eth1 inet dhcp
Code formatting is done in several ways:
If it's inline code you add backticks (`) around it. This is some inline formatting
.
For code on it's own line you indent it by four spaces:
This is code on it's own line.
Or you can use the code button on the toolbar:
Which can also be activated with Ctrl+K.
For more information see formatting help.
One incredibly annoying behaviour of the editor shortcut is that it doesn't account for levels. If you try to embed code within a list, you'll need to add the indentation once more (and more times per level). So:
- some text
code
Shows up as:
some text
code
You can add it manually, but one trick is to indent the code, then in the first line of the block, add a character at the start of the line, and then indent it again:
- some text
code
Becomes:
- some text
code
Then:
- some text
a code
Then:
- some text
a code
And finally delete that extra character.
Backticks work in lists, but backtick-quoted code blocks aren't as nicely formatted as the indented version.