Skip to content

Commit 27167da

Browse files
committed
docs(progress): 用图片替换文本示例并优化表格格式
1 parent 06e68bf commit 27167da

4 files changed

Lines changed: 366 additions & 28 deletions

File tree

docs/images/prog-bar.svg

Lines changed: 172 additions & 0 deletions
Loading

docs/images/prog-txt.svg

Lines changed: 173 additions & 0 deletions
Loading

docs/progress.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ func main() {
5353

5454
Output preview:
5555

56-
```txt
57-
[==============>-------------] 50%(55/110)
58-
[============================] 100%(110/110)
59-
```
56+
![prog-bar](images/prog-bar.svg)
6057

6158
### Full
6259

@@ -88,10 +85,7 @@ p.Finish()
8885

8986
Output preview:
9087

91-
```txt
92-
50%(50/100)
93-
100%(100/100)
94-
```
88+
![prog-txt](images/prog-txt.svg)
9589

9690
### Counter
9791

@@ -302,15 +296,15 @@ Output preview:
302296

303297
### Internal Widgets
304298

305-
Widget Name | Usage example | Description
299+
Widget Name | Usage example | Description
306300
-------------|--------------------|-------------------------------------------
307-
`max` | `{@max}` | Display max steps for progress bar
308-
`current` | `{@current}` | Display current steps for progress bar
309-
`percent` | `{@percent:4s}` | Display percent for progress run
310-
`elapsed` | `{@elapsed:7s}` | Display has elapsed time for progress run
311-
`remaining` | `{@remaining:7s}` | Display remaining time
312-
`estimated` | `{@estimated:-7s}` | Display estimated time
313-
`memory` | `{@memory:6s}` | Display memory consumption size
301+
`max` | `{@max}` | Display max steps for progress bar
302+
`current` | `{@current}` | Display current steps for progress bar
303+
`percent` | `{@percent:4s}` | Display percent for progress run
304+
`elapsed` | `{@elapsed:7s}` | Display has elapsed time for progress run
305+
`remaining` | `{@remaining:7s}` | Display remaining time
306+
`estimated` | `{@estimated:-7s}` | Display estimated time
307+
`memory` | `{@memory:6s}` | Display memory consumption size
314308

315309
### Custom Progress Bar
316310

docs/zh-CN/progress.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func main() {
5959
[============================] 100%(110/110)
6060
```
6161

62+
![prog-bar](../images/prog-bar.svg)
63+
6264
### Full
6365

6466
`Full` 会在进度条旁显示更完整的运行信息,包括当前进度、耗时、预计耗时和内存占用。
@@ -89,10 +91,7 @@ p.Finish()
8991

9092
效果示例:
9193

92-
```txt
93-
50%(50/100)
94-
100%(100/100)
95-
```
94+
![prog-txt](../images/prog-txt.svg)
9695

9796
### Counter
9897

@@ -315,15 +314,15 @@ func main() {
315314

316315
### 内置 Widgets
317316

318-
Widget Name | Usage example | Description
317+
Widget Name | Usage example | Description
319318
-------------|--------------------|----------------------------
320-
`max` | `{@max}` | 显示进度条最大步数
321-
`current` | `{@current}` | 显示当前进度步数
322-
`percent` | `{@percent:4s}` | 显示当前进度百分比
323-
`elapsed` | `{@elapsed:7s}` | 显示已耗时
324-
`remaining` | `{@remaining:7s}` | 显示剩余时间
325-
`estimated` | `{@estimated:-7s}` | 显示预计耗时
326-
`memory` | `{@memory:6s}` | 显示内存占用
319+
`max` | `{@max}` | 显示进度条最大步数
320+
`current` | `{@current}` | 显示当前进度步数
321+
`percent` | `{@percent:4s}` | 显示当前进度百分比
322+
`elapsed` | `{@elapsed:7s}` | 显示已耗时
323+
`remaining` | `{@remaining:7s}` | 显示剩余时间
324+
`estimated` | `{@estimated:-7s}` | 显示预计耗时
325+
`memory` | `{@memory:6s}` | 显示内存占用
327326

328327
### 自定义进度条
329328

0 commit comments

Comments
 (0)