docs: init docs
All checks were successful
Build and Release / Build (darwin-arm64) (push) Successful in 19s
Build and Release / Build (darwin-amd64) (push) Successful in 20s
Build and Release / Build (linux-arm64) (push) Successful in 17s
Build and Release / Build (linux-amd64) (push) Successful in 20s
Build and Release / Build (windows-arm64) (push) Successful in 16s
Build and Release / Build (windows-amd64) (push) Successful in 19s
Build and Release / Create Release (push) Has been skipped
Deploy docs / deploy (push) Successful in 45s

This commit is contained in:
CDN 2025-04-23 14:16:16 +08:00
parent ba66894e42
commit deae4a6272
Signed by: CDN
GPG key ID: 0C656827F9F80080
20 changed files with 2887 additions and 1 deletions

63
docs/zh-Hans/examples.md Normal file
View file

@ -0,0 +1,63 @@
---
title: 命令示例
description: Sub-CLI命令实际应用的实用示例
---
# 命令示例
本页面提供了Sub-CLI命令在常见字幕处理任务中的实用示例。
## 格式转换示例
在各种字幕格式之间进行转换:
```bash
# 从SRT转换为WebVTT
sub-cli convert subtitles.srt subtitles.vtt
# 从LRC转换为SRT
sub-cli convert lyrics.lrc subtitles.srt
# 从WebVTT转换为纯文本去除时间戳
sub-cli convert subtitles.vtt plain_text.txt
# 从SRT转换为LRC
sub-cli convert subtitles.srt lyrics.lrc
```
## 同步示例
在字幕文件之间同步时间轴:
```bash
# 使用另一个SRT文件作为参考来同步SRT文件
sub-cli sync reference.srt target.srt
# 使用另一个LRC文件作为参考来同步LRC文件
sub-cli sync reference.lrc target.lrc
```
注意同步功能仅适用于相同格式的文件之间。如果源文件和目标文件之间的条目数不同Sub-CLI将显示警告并适当地缩放时间轴。
## 格式化示例
格式化字幕文件以确保样式一致:
```bash
# 格式化SRT文件
sub-cli fmt subtitles.srt
# 格式化LRC文件
sub-cli fmt lyrics.lrc
# 格式化WebVTT文件
sub-cli fmt subtitles.vtt
```
格式化确保:
- 顺序条目编号
- 一致的时间戳格式
- 适当的间距和换行
- 格式特定的标准合规性
这些示例展示了Sub-CLI在处理各种字幕操作任务方面的多功能性。有关每个命令和所有可用选项的详细信息请参阅[命令参考](/zh-Hans/commands)页面。