Initial commit

This commit is contained in:
Kenan Zhu authored and GitHub committed 2026-05-21 21:23:13 +08:00
commit 04174b399f
35 files changed
+2020

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
---
title: 'Code blocks'
description: 'Display inline code and code blocks'
icon: 'code'
---
## Inline code
To denote a `word` or `phrase` as code, enclose it in backticks (`).
```
To denote a `word` or `phrase` as code, enclose it in backticks (`).
```
## Code blocks
Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language.
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````md
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
## Code groups
To display the same snippet in multiple languages as tabs, use the `CodeGroup` component. See [Components](/essentials/components#code-groups) for usage.