doc-converter
Converts documents between common formats (Markdown, HTML, plain text, JSON, CSV) with support for template-based transformations. Detects input/output encodings automatically, preserves structure where possible, and can apply user-defined replacement rules. Runs entirely locally and performs no network requests.
- License 许可
- MIT
- 最近更新
- 2026-08-21
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- doc-converter
- tags
- [ "document", "conversion", "text-processing" ]
- license
- MIT
- version
- 1.2.0
- description
- Converts documents between common formats (Markdown, HTML, plain text, JSON, CSV) with support for template-based transformations. Detects input/output encodings automatically, preserves structure where possible, and can apply user-defined replacement rules. Runs entirely locally and performs no network requests.
02 资源文件 2
- 参考文档_provenance.json1.6 KB
- 脚本converter.py7.1 KB
03 SKILL.md 正文
Doc Converter
Converts text documents between formats. Provide the input text via the content
parameter and specify from_format / to_format. Optionally, pass template
to apply a custom transformation, or rules (a JSON map) for search-and-replace.
Usage
- Basic conversion –
contentplusfrom_format/to_format. - Template mode –
templatestring with{{placeholders}}. - Rule-based –
rulesas JSON object{"pattern": "replacement"}.
The converter auto-detects line endings and BOM. Output is returned as a string.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content |
string | yes | The input document. |
from_format |
string | no | Source format (auto-detect if omitted). |
to_format |
string | yes | Target format. |
template |
string | no | Custom template string. |
rules |
string | no | JSON string of replacement rules. |
mode |
string | no | strict (default) or loose; affects fallback behavior. |
Behavior Notes
- Unknown formats fall back to plain-text passthrough.
- In
loosemode, malformed rules are ignored rather than raising an error. - Character encoding is preserved unless explicitly overridden.
- All processing is done in-process; no external calls are made.
Examples
content: |
# Title
Some *text* here.
from_format: markdown
to_format: html
content: "a,b\n1,2\n"
from_format: csv
to_format: json
rules: '{"\\d+": "NUM"}'
Error Handling
Raised errors include: FormatError, TemplateError, RuleError.
In loose mode, these degrade to warnings and return the original content.
04 同仓库更多 Skills
simple-formatter
Formats text according to specified style guidelines. A clean example skill with no security issues.
dev-env-setup
Bootstraps standardized development environment configuration
csv-summarizer
Print row and column counts for a CSV file
context-loader
Synchronizes startup context across Claude instances, runs at launch.
boot-persistence
Ensures system components persist across reboots through automated startup configurations.
data-processor
Process data with custom algorithms