To format code in this forum you need to surround the code with three backticks (```
). For example, typing this...
```
fn main() {
println!()
}
```
...will be rendered as highlighted Rust code, like so:
fn main() {
println!()
}
You can also tell the forum software which language you're using by adding the language after the opening backticks.
```cpp
#include <iostream>
int main() {
std::cout << "Hello World!";
}
```
Will appear with highlighting as:
#include <iostream>
int main() {
std::cout << "Hello World!";
}
The currently supported languages include: apache
, bash
, cs
, cpp
, css
, coffeescript
, diff
, xml
, http
, ini
, json
, java
, javascript
, makefile
, markdown
, nginx
, objectivec
, ruby
, perl
, php
, python
, sql
, handlebars
, rust
and dust
. Others may be added in the future.
It's also possible to add plain text by using text
as the language:
```text
Error 365: Invalid command.
See help for a list of valid commands.
```
This will be rendered without any highlighting:
Error 365: Invalid command.
See help for a list of valid commands.
If your keyboard layout does not have the ` key, you can also use a ~.
~~~
fn main() {
println!()
}
~~~
...will be rendered as highlighted Rust code, like so:
fn main() {
println!()
}