【Posting Guide】Code Syntax Highlighting Format
Posted: 2023年 Aug 24日 20:14
Now syntax highlighting is supported for the following code. It aligns with our programming languages.
To avoid conflict with Markdown code, syntax highlighting is currently only supported using the [syntax] tag.
The syntax highlighting format is as follows:
Code: Select all
[syntax=language]
[/syntax]
The table below shows the supported programming languages. If there is a request for adding a new language, please post a reply in the forum.
| language | style name |
|---|---|
| C++ | cpp |
| C | c |
| CSS | css |
| Diff | diff |
| HTML, XML | xml |
| Ini | ini |
| JSON | json |
| Java | java |
| JavaScript | javascript |
| Makefile | makefile |
| Markdown | markdown |
| Python | python |
| Shell Session | shell |
| Dust | dust |
| Go | go |
| Lua | lua |
| TypeScript | typescript |
Below is a highlighted display of C code.
Code: Select all
[syntax=c]
#include <stdio.h>
int main() {
printf("hellow world!\n");
return 0;
}
[/syntax]
Code: Select all
#include <stdio.h>
int main() {
printf("hellow world!\n");
return 0;
}