Code Formatting and Syntax Highlighting

To format code in this forum you need to surround the code with three backticks (```). For example, typing the following:

```
fn main() {
    println!()
}
``` 

Will be rendered as highlighted Rust code, like so:

fn main() {
    println!("Hello, world!")
}

Further, you can tell the forum which language you’re using by adding the language name following the backticks:

```cpp
#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}
```

Which will appear as so:

#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}

Rust has been set as the default language for the forum.

Additional 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.

As the forum grows, we will work to support move syntax as well.

3 Likes

thanks for sharing! it’s helpful :blush:

1 Like