feat(docs-i18n): translate all documentation into 20 languages

All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
This commit is contained in:
SnapOtter
2026-07-11 13:52:47 +08:00
committed by GitHub
parent 00b651c9f8
commit 4963ab3bbd
3620 changed files with 306134 additions and 0 deletions
@@ -0,0 +1,53 @@
---
description: "根据 CSV 或 JSON 数据创建柱状图、折线图或饼图。"
i18n_source_hash: d3c39384457b
i18n_provenance: human
i18n_output_hash: f386d98f072b
---
# Chart Maker {#chart-maker}
根据 CSV 或 JSON 数据创建柱状图、折线图或饼图。返回渲染图表的 PNG 图片。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/chart-maker`
接受包含 CSV 或 JSON 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| kind | string | No | `"bar"` | 图表类型:`bar``line``pie` |
| title | string | No | - | 图表标题(最多 120 个字符) |
| width | integer | No | `960` | 图表宽度(单位像素,320-2048) |
| height | integer | No | `540` | 图表高度(单位像素,240-1536) |
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/chart-maker \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@sales.csv" \
-F 'settings={"kind": "line", "title": "Monthly Sales", "width": 960, "height": 540}'
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/sales_chart.png",
"originalSize": 1024,
"processedSize": 48500
}
```
## Notes {#notes}
- 输入必须是 `.csv``.json` 文件。CSV 文件应带有包含列名的表头行。
- 第一列用作类别标签;第二列必须为数值,用于提供数据值。只使用两列。
- JSON 输入应为一组 `{label, value}` 对象,或一个普通对象,其键成为标签、值成为数据点。
- 最多 100 个数据点。所有值必须大于或等于零。
- 无论输入格式如何,输出始终是 PNG 图片。
@@ -0,0 +1,49 @@
---
description: "在 Word、OpenDocument、RTF 和纯文本格式之间转换。"
i18n_source_hash: 89771292569d
i18n_provenance: human
i18n_output_hash: 3c8b42693a30
---
# Convert Document {#convert-document}
使用 LibreOffice 在 WordDOCX)、OpenDocumentODT)、RTF 和纯文本格式之间转换文档。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/convert-document`
接受包含 Word/ODT/RTF/TXT 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| format | string | Yes | - | 输出格式:`docx``odt``rtf``txt` |
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/convert-document \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@report.docx" \
-F 'settings={"format": "odt"}'
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.docx``.doc``.odt``.rtf``.txt`
- 转换由服务器上以无头模式运行的 LibreOffice 处理。
- 复杂格式(宏、嵌入对象)在格式之间转换时可能无法保留。
- 输出格式必须与输入格式不同。
@@ -0,0 +1,49 @@
---
description: "在 PowerPoint 和 OpenDocument 演示文稿格式之间转换。"
i18n_source_hash: 08ba415d39ac
i18n_provenance: human
i18n_output_hash: 395ff35f7db7
---
# Convert Presentation {#convert-presentation}
在 PowerPointPPTX)和 OpenDocument 演示文稿(ODP)格式之间转换演示文稿。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/convert-presentation`
接受包含 PowerPoint/ODP 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| format | string | Yes | - | 输出格式:`pptx``odp` |
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/convert-presentation \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@slides.pptx" \
-F 'settings={"format": "odp"}'
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.pptx``.ppt``.odp`
- 转换由服务器上以无头模式运行的 LibreOffice 处理。
- 动画和过渡效果在不同格式之间可能无法保留。
- 输出格式必须与输入格式不同。
@@ -0,0 +1,49 @@
---
description: "在 Excel、OpenDocument 和 CSV 格式之间转换。"
i18n_source_hash: b813b1b06962
i18n_provenance: human
i18n_output_hash: f5e2878625a5
---
# Convert Spreadsheet {#convert-spreadsheet}
在 ExcelXLSX)、OpenDocument 电子表格(ODS)和 CSV 格式之间转换电子表格。多工作表工作簿在转换为 CSV 时会导出第一个工作表。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/convert-spreadsheet`
接受包含 Excel/ODS/CSV 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| format | string | Yes | - | 输出格式:`xlsx``ods``csv` |
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/convert-spreadsheet \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@data.xlsx" \
-F 'settings={"format": "csv"}'
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.xlsx``.xls``.ods``.csv`
- 将多工作表工作簿转换为 CSV 时,只导出第一个工作表。
- 公式会被求值,并在 CSV 输出中导出为静态值。
- 输出格式必须与输入格式不同。
+48
View File
@@ -0,0 +1,48 @@
---
description: "将多个文件打包成单个 ZIP 压缩包。"
i18n_source_hash: 9ff1250dbd36
i18n_provenance: human
i18n_output_hash: ebd3678d3230
---
# Create ZIP {#create-zip}
将任意类型的多个文件打包成单个 ZIP 压缩包。重复的文件名会被自动去重。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/create-zip`
接受包含两个或更多文件的 multipart 表单数据。不需要 settings 字段。
## Parameters {#parameters}
此工具没有可配置的参数。上传 2 到 50 个任意类型的文件进行打包。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/create-zip \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@report.pdf" \
-F "file=@data.csv" \
-F "file=@photo.jpg"
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/archive.zip",
"originalSize": 3500000,
"processedSize": 2800000
}
```
## Notes {#notes}
- 需要 2 到 50 个输入文件。
- 接受任意文件类型;对输入格式没有限制。
- 如果多个文件同名,会自动用数字后缀去重。
- 输出压缩包使用标准 ZIP 压缩(deflate)。
+59
View File
@@ -0,0 +1,59 @@
---
description: "在 CSV 与 ExcelXLSX)之间双向转换。"
i18n_source_hash: 213297311e36
i18n_provenance: human
i18n_output_hash: 2f719f0d2613
---
# CSV to Excel {#csv-to-excel}
在 CSV 与 Excel(XLSX)格式之间双向转换。上传 CSV 或 TSV 文件可得到 XLSX,或上传 XLSX 文件可得到 CSV。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/csv-excel`
接受包含 CSV、TSV 或 XLSX 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| sheet | integer | No | `1` | 从 XLSX 转换时要导出的工作表编号(最小为 1) |
## Example Request {#example-request}
CSV 转 Excel
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/csv-excel \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@data.csv" \
-F 'settings={"sheet": 1}'
```
Excel 转 CSV
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/csv-excel \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@report.xlsx" \
-F 'settings={"sheet": 2}'
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/data.xlsx",
"originalSize": 2048,
"processedSize": 5120
}
```
## Notes {#notes}
- 转换方向根据输入文件扩展名自动检测:`.csv``.tsv` 生成 `.xlsx`,而 `.xlsx` 生成 `.csv`
- `sheet` 参数仅在从 XLSX 转换时适用。它用于选择要导出的工作表。
- 除 CSV 外,还支持 TSV(制表符分隔值)文件。
+60
View File
@@ -0,0 +1,60 @@
---
description: "在 CSV 与 JSON 之间双向转换。"
i18n_source_hash: 978c08ad46d3
i18n_provenance: human
i18n_output_hash: 96c06a2986a3
---
# CSV to JSON {#csv-to-json}
在 CSV 与 JSON 格式之间双向转换。上传 CSV 或 TSV 文件可得到 JSON 对象数组,或上传 JSON 数组可得到 CSV 文件。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/csv-json`
接受包含 CSV、TSV 或 JSON 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| pretty | boolean | No | `true` | 以带缩进的方式美化输出 JSON |
## Example Request {#example-request}
CSV 转 JSON
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/csv-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@users.csv" \
-F 'settings={"pretty": true}'
```
JSON 转 CSV
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/csv-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@users.json" \
-F 'settings={}'
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/users.json",
"originalSize": 1500,
"processedSize": 2200
}
```
## Notes {#notes}
- 转换方向根据输入文件扩展名自动检测:`.csv``.tsv` 生成 `.json`,而 `.json` 生成 `.csv`
- `pretty` 参数只影响 JSON 输出。设为 `false` 时,输出为紧凑的单行 JSON 字符串。
- JSON 输入必须是键一致的对象数组。每个对象成为一行,每个键成为一个列标题。
- 除 CSV 外,还支持 TSV(制表符分隔值)文件。
@@ -0,0 +1,49 @@
---
description: "将 EPUB 转换为 PDF、DOCX、HTML 或 Markdown。"
i18n_source_hash: 7d94fc18ca97
i18n_provenance: human
i18n_output_hash: 977c0caf49df
---
# Convert EPUB {#convert-epub}
将 EPUB 电子书转换为 PDF、WordDOCX)、HTML 或 Markdown。不会获取书中的远程资源。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/epub-convert`
接受包含 EPUB 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| format | string | Yes | - | 输出格式:`pdf``docx``html``md` |
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/epub-convert \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@book.epub" \
-F 'settings={"format": "pdf"}'
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.epub`
- 出于安全考虑,不会获取 EPUB 中嵌入的远程资源(外部图片、字体)。
- 转换后输出的图像保真度可能因 EPUB 结构而异。
- 转换由服务器上的 Pandoc 处理。
@@ -0,0 +1,46 @@
---
description: "将电子表格转换为 PDF。"
i18n_source_hash: 4dbe2a810ea6
i18n_provenance: human
i18n_output_hash: 0493f22917c8
---
# Excel to PDF {#excel-to-pdf}
将 Excel、OpenDocument 或 CSV 电子表格转换为 PDF。较宽的工作表可能会分页到多页。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/excel-to-pdf`
接受包含 Excel/ODS/CSV 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传电子表格即可将其转换为 PDF。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/excel-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@budget.xlsx"
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.xlsx``.xls``.ods``.csv`
- 较宽的工作表在生成的 PDF 中可能被拆分到多页。
- 图表和条件格式会在 PDF 输出中渲染。
- 转换由服务器上以无头模式运行的 LibreOffice 处理。
@@ -0,0 +1,46 @@
---
description: "安全地从 ZIP 压缩包中提取文件,并防范压缩炸弹。"
i18n_source_hash: 484a1f1051b8
i18n_provenance: human
i18n_output_hash: 5098f0bdd631
---
# Extract ZIP {#extract-zip}
安全地从 ZIP 压缩包中提取文件。单文件压缩包直接返回其中包含的文件;多文件压缩包返回一个包含所提取内容的扁平 ZIP。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/extract-zip`
接受包含 ZIP 文件的 multipart 表单数据。不需要 settings 字段。
## Parameters {#parameters}
此工具没有可配置的参数。上传要提取的 `.zip` 文件。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/extract-zip \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@archive.zip"
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/archive_extracted.zip",
"originalSize": 2800000,
"processedSize": 3500000
}
```
## Notes {#notes}
- 只接受 `.zip` 文件作为输入。
- 如果压缩包只包含一个文件,则直接返回该文件(不再包裹在 ZIP 中)。
- 如果压缩包包含多个文件,则返回一个扁平 ZIP,所有文件都提取到根级别(嵌套目录结构会被扁平化)。
- 内置的压缩炸弹防护会拒绝压缩率过高或文件数量过多的压缩包,以防止资源耗尽。
@@ -0,0 +1,46 @@
---
description: "将 HTML 文件转换为 PDF。"
i18n_source_hash: 20b9ae147db5
i18n_provenance: human
i18n_output_hash: 536955781218
---
# HTML to PDF {#html-to-pdf}
将 HTML 文件转换为带样式的 PDF 文档。出于隐私考虑,远程资源(外部图片、样式表、脚本)会被禁用。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/html-to-pdf`
接受包含 HTML 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传 HTML 文件即可将其转换为 PDF。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/html-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@page.html"
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.html``.htm`
- 出于隐私和安全考虑,不会获取远程资源(通过 URL 引用的图片、样式表、脚本)。
- 内联样式和嵌入图片(data URI)会被保留。
- 转换由服务器上的 WeasyPrint 处理。
+59
View File
@@ -0,0 +1,59 @@
---
description: "在 JSON 与 XML 之间双向转换。"
i18n_source_hash: b3a6ded0c64a
i18n_provenance: human
i18n_output_hash: 14f0fbc75e67
---
# JSON to XML {#json-to-xml}
在 JSON 与 XML 格式之间双向转换。上传 JSON 文件可得到 XML,或上传 XML 文件可得到 JSON。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/json-xml`
接受包含 JSON 或 XML 文件和 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| pretty | boolean | No | `true` | 以带缩进的方式美化输出 |
## Example Request {#example-request}
JSON 转 XML
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/json-xml \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@config.json" \
-F 'settings={"pretty": true}'
```
XML 转 JSON
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/json-xml \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@config.xml" \
-F 'settings={"pretty": true}'
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/config.xml",
"originalSize": 850,
"processedSize": 1200
}
```
## Notes {#notes}
- 转换方向根据输入文件扩展名自动检测:`.json` 生成 `.xml`,而 `.xml` 生成 `.json`
- `pretty` 参数对两个方向都适用。当为 `false` 时,输出为紧凑且无缩进的格式。
- 在往返转换过程中,XML 属性和嵌套结构会尽可能被保留。
@@ -0,0 +1,46 @@
---
description: "将 Markdown 文件转换为 Word 文档(DOCX)。"
i18n_source_hash: 979cb8ee13f2
i18n_provenance: human
i18n_output_hash: 7fdfdb0b0c80
---
# Markdown to Word {#markdown-to-word}
将 Markdown 文件转换为 Word 文档(DOCX),保留标题、列表、代码块及其他格式。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/markdown-to-docx`
接受包含 Markdown 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传 Markdown 文件即可将其转换为 DOCX。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/markdown-to-docx \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@README.md"
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/README.docx",
"originalSize": 4500,
"processedSize": 18200
}
```
## Notes {#notes}
- 接受的输入格式:`.md``.markdown`
- 这是一个快速(同步)工具,直接返回结果。
- 标题、加粗、斜体、链接、代码块和列表会映射到 Word 样式。
- 转换由服务器上的 Pandoc 处理。
@@ -0,0 +1,46 @@
---
description: "将 Markdown 文件转换为独立的 HTML 页面。"
i18n_source_hash: 3ef805e8fc8c
i18n_provenance: human
i18n_output_hash: cc97c8a1c089
---
# Markdown to HTML {#markdown-to-html}
将 Markdown 文件转换为独立的 HTML 页面。源文件中引用的远程图片在输出中保持原样。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/markdown-to-html`
接受包含 Markdown 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传 Markdown 文件即可将其转换为 HTML。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/markdown-to-html \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@notes.md"
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/notes.html",
"originalSize": 3200,
"processedSize": 5800
}
```
## Notes {#notes}
- 接受的输入格式:`.md``.markdown`
- 这是一个快速(同步)工具,直接返回结果。
- 输出是一个带内联样式的自包含 HTML 页面。
- Markdown 源文件中的远程图片 URL 保持原样,不会被获取。
@@ -0,0 +1,46 @@
---
description: "将 Markdown 文件转换为带样式的 PDF。"
i18n_source_hash: 18474dc8772a
i18n_provenance: human
i18n_output_hash: 2864ac73375f
---
# Markdown to PDF {#markdown-to-pdf}
将 Markdown 文件转换为带样式的 PDF 文档。出于隐私考虑,远程资源已被禁用。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/markdown-to-pdf`
接受包含 Markdown 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传一个 Markdown 文件即可将其转换为 PDF。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/markdown-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@document.md"
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.md``.markdown`
- 出于隐私和安全考虑,不会获取远程资源(通过 URL 引用的图像、样式表)。
- Markdown 会先被渲染为 HTML,然后通过 WeasyPrint 转换为 PDF。
- 代码块、表格及其他 Markdown 元素在 PDF 输出中会带有样式。
+48
View File
@@ -0,0 +1,48 @@
---
description: "将多个列一致的 CSV 或 TSV 文件合并为一个。"
i18n_source_hash: 109b5f399ac8
i18n_provenance: human
i18n_output_hash: 474eeae6471f
---
# Merge CSVs {#merge-csvs}
将多个 CSV 或 TSV 文件合并为单个文件。所有输入文件必须具有相同的列标题。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/merge-csvs`
接受包含两个或更多 CSV 文件的 multipart 表单数据。无需 settings 字段。
## Parameters {#parameters}
此工具没有可配置的参数。上传 2 到 20 个列标题一致的 CSV 或 TSV 文件。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/merge-csvs \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@january.csv" \
-F "file=@february.csv" \
-F "file=@march.csv"
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/merged.csv",
"originalSize": 30000,
"processedSize": 28500
}
```
## Notes {#notes}
- 需要 2 到 20 个输入文件。
- 所有文件必须共享相同的列标题。如果列不匹配,合并将失败。
- 标题行在输出中只包含一次;来自所有文件的数据行按上传顺序拼接。
- CSV 和 TSV 文件都被接受,但单个请求中的所有文件应使用相同的分隔符。
@@ -0,0 +1,46 @@
---
description: "将演示文稿转换为 PDF。"
i18n_source_hash: 49bd71c46bed
i18n_provenance: human
i18n_output_hash: 9572e185cb4a
---
# PowerPoint to PDF {#powerpoint-to-pdf}
将 PowerPoint 或 OpenDocument 演示文稿转换为 PDF,每张幻灯片一页。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/powerpoint-to-pdf`
接受包含 PowerPoint/ODP 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传一个演示文稿即可将其转换为 PDF。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/powerpoint-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@slides.pptx"
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.pptx``.ppt``.odp`
- 每张幻灯片在 PDF 中成为一页。
- 转换由服务器上以无头模式运行的 LibreOffice 处理。
- 动画和过渡效果不会包含在 PDF 输出中。
+50
View File
@@ -0,0 +1,50 @@
---
description: "按行数将 CSV 拆分为更小的文件。"
i18n_source_hash: a35dce4a99a3
i18n_provenance: human
i18n_output_hash: 16272439ccb6
---
# Split CSV {#split-csv}
按行数将大型 CSV 或 TSV 文件拆分为更小的文件。返回一个包含各部分的 ZIP 归档。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/split-csv`
接受包含 CSV 文件和一个 JSON `settings` 字段的 multipart 表单数据。
## Parameters {#parameters}
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| rowsPerFile | integer | 否 | `1000` | 每个输出文件的数据行数(1-1,000,000 |
| keepHeader | boolean | 否 | `true` | 在每个输出文件中重复标题行 |
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/split-csv \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@large-dataset.csv" \
-F 'settings={"rowsPerFile": 500, "keepHeader": true}'
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/large-dataset_parts.zip",
"originalSize": 1048576,
"processedSize": 1050000
}
```
## Notes {#notes}
- 输出始终是一个包含拆分后 CSV 各部分的 ZIP 归档,按顺序命名(例如 `part-1.csv``part-2.csv`)。
- 当 `keepHeader``true` 时,每部分都包含原始标题行,因此每个文件都可以独立使用。
- CSV 和 TSV 文件都被接受为输入。
- 行数仅指数据行;标题行不计入其中。
+46
View File
@@ -0,0 +1,46 @@
---
description: "将 Word、Markdown、HTML 或纯文本文件转换为 EPUB。"
i18n_source_hash: 63e1afa91c52
i18n_provenance: human
i18n_output_hash: 606045456618
---
# Convert to EPUB {#convert-to-epub}
将 Word 文档、Markdown、HTML 或纯文本文件转换为 EPUB 电子书格式。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/to-epub`
接受包含 Word/Markdown/HTML/TXT 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传一个文档即可将其转换为 EPUB。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/to-epub \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@manuscript.docx"
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.docx``.md``.html``.txt`
- EPUB 输出遵循 EPUB 3 规范。
- 源文档中的标题用于生成目录。
- 转换由服务器上的 Pandoc 处理。
@@ -0,0 +1,46 @@
---
description: "将 Word 文档转换为 PDF。"
i18n_source_hash: f814ba1a1a53
i18n_provenance: human
i18n_output_hash: 0e3f59d96990
---
# Word to PDF {#word-to-pdf}
将 Word 文档、OpenDocument 文本、RTF 或纯文本文件转换为 PDF。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/word-to-pdf`
接受包含 Word/ODT/RTF/TXT 文件的 multipart 表单数据。
## Parameters {#parameters}
此工具没有可配置的参数。上传一个文档即可将其转换为 PDF。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/word-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@report.docx"
```
## Example Response {#example-response}
返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
```
## Notes {#notes}
- 接受的输入格式:`.docx``.doc``.odt``.rtf``.txt`
- 转换由服务器上以无头模式运行的 LibreOffice 处理。
- 有可用的嵌入字体时会使用文档中嵌入的字体;否则用系统字体替代。
- 页眉、页脚、表格和图像在 PDF 输出中会保留。
+46
View File
@@ -0,0 +1,46 @@
---
description: "从 XML 中提取重复元素并生成 CSV 表格。"
i18n_source_hash: 3ab1019bff8a
i18n_provenance: human
i18n_output_hash: 2df6bee653a3
---
# XML to CSV {#xml-to-csv}
从 XML 文件中提取重复元素,生成扁平的 CSV 表格。该工具会自动找到 XML 树中的第一个对象数组,并将每个元素映射为一行。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/xml-to-csv`
接受包含 XML 文件的 multipart 表单数据。无需 settings 字段。
## Parameters {#parameters}
此工具没有可配置的参数。重复元素会从 XML 结构中自动检测。
## Example Request {#example-request}
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/xml-to-csv \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@catalog.xml"
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/catalog.csv",
"originalSize": 4500,
"processedSize": 1800
}
```
## Notes {#notes}
- 仅接受 `.xml` 文件作为输入。
- 该工具会扫描 XML 树以找到第一组重复的同级元素,并将它们用作行。
- 每个唯一的子元素或属性名会成为一个 CSV 列标题。
- 这是一个单向转换。若需 JSON/XML 双向转换,请使用 [JSON to XML](/zh-CN/tools/files/json-xml) 工具。
+55
View File
@@ -0,0 +1,55 @@
---
description: "在 YAML 与 JSON 之间双向转换。"
i18n_source_hash: acf8ca21ee99
i18n_provenance: human
i18n_output_hash: 6a8b52e9fe79
---
# YAML / JSON {#yaml-json}
在 YAML 与 JSON 格式之间双向转换。上传 YAML 文件可得到 JSON,或上传 JSON 文件可得到 YAML。
## API Endpoint {#api-endpoint}
`POST /api/v1/tools/files/yaml-json`
接受包含 YAML 或 JSON 文件的 multipart 表单数据。无需 settings 字段。
## Parameters {#parameters}
此工具没有可配置的参数。转换方向由输入文件的扩展名决定。
## Example Request {#example-request}
YAML 转 JSON
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/yaml-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@config.yaml"
```
JSON 转 YAML
```bash
curl -X POST http://localhost:1349/api/v1/tools/files/yaml-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@config.json"
```
## Example Response {#example-response}
```json
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/config.json",
"originalSize": 620,
"processedSize": 780
}
```
## Notes {#notes}
- 转换方向会从输入文件的扩展名自动检测:`.yaml``.yml` 生成 `.json`,而 `.json` 生成 `.yaml`
- `.yaml``.yml` 两种扩展名都被接受。
- 在多文档 YAML 文件中,仅转换第一个文档;由 `---` 分隔的其他文档会被忽略。