docs: update code block sample

This commit is contained in:
ZhenShuo Leo
2025-12-15 21:17:57 +08:00
parent ff9a860af9
commit f487e616bf
4 changed files with 18 additions and 74 deletions

View File

@@ -65,7 +65,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
## Code Blocks
### Code block with backticks
### General code block
```html
<!DOCTYPE html>
@@ -80,8 +80,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html>
```
### Code block indented with four spaces
### Code block with title and line highlight
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html>
<html lang="en">
<head>
@@ -92,22 +93,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
<p>Test</p>
</body>
</html>
### Code block with Hugo's internal highlight shortcode
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
{{< /highlight >}}
```
## List Types

View File

@@ -80,34 +80,20 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
</html>
```
### 4スペースのインデントによるコードブロック
### タイトルと行ハイライト機能付きのコードブロック
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html>
<html lang="ja">
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 資料の例</title>
<title>Example HTML5 Document</title>
</head>
<body>
<p>テスト</p>
<p>Test</p>
</body>
</html>
### Hugo 内のショートコード・ハイライトを利用したコードブロック
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>HTML5 資料の例</title>
</head>
<body>
<p>テスト</p>
</body>
</html>
{{< /highlight >}}
```
## リスト形式

View File

@@ -65,7 +65,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
## Code Blocks
### Code block with backticks
### General code block
```html
<!DOCTYPE html>
@@ -80,8 +80,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html>
```
### Code block indented with four spaces
### Code block with title and line highlight
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html>
<html lang="en">
<head>
@@ -92,22 +93,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
<p>Test</p>
</body>
</html>
### Code block with Hugo's internal highlight shortcode
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
{{< /highlight >}}
```
## List Types

View File

@@ -65,7 +65,7 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
## 代码块
### 带反引号的代码块
### 一般的代码块
```html
<!DOCTYPE html>
@@ -80,8 +80,9 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
</html>
```
### 缩进四个空格的代码块
### 带有标题和行高亮的代码块
```html {title="example.html" lineNos=inline hl_lines=[4,"7-9"]}
<!DOCTYPE html>
<html lang="en">
<head>
@@ -92,22 +93,7 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
<p>Test</p>
</body>
</html>
### 带有 Hugo 内部高亮简码的代码块
{{< highlight html "linenos=table,hl_lines=4 7-9" >}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
{{< /highlight >}}
```
## 列表