SuperAPI AI Directory

docx-perfect

Office & productivity

View repository

Updated 10-15 10:21

About this skill

DOCX Document Beautification Expert

Convert content in Word documents into professional table formats, with support for versioned iterative optimization.

Quick Start

Document beautification uses incremental version management (v0.1, v0.2, ..., v1.0), generating a new version after optimizing one section each time.

Workflow

1. Analyze the source document

python -c "import sys; sys.stdout.reconfigure(encoding='utf-8'); from docx import Document; doc = Document('source.docx'); [print(p.text.strip()) for p in doc.paragraphs if p.text.strip()]"

2. Determine the section to optimize this time

Identify the section title that needs beautification, such as:

  • 3.1 实体识别 → Create an entity attribute table
  • 3.2 实体间联系 → Create a relationship table
  • 5.2 索引优化设计 → Create an index summary table

3. Create a table

Use scripts/create_table.py to create a table, referring to the script template below.

4. Apply styles

Use a unified style:

  • Header: Dark blue background (#4472C4) + white bold text
  • Data rows: Alternating white/light gray row colors
  • Borders: Black single-line borders

5. Version number management

Automatically increment the version number and save as a new file:文档名-v0.X.docx

Script Template

See details in scripts/README.md

Common Table Patterns

Entity Attribute Table

| 属性名 | 类型/约束 | 说明 |
|--------|-----------|------|
| field1 | INT, PK   | 主键   |

Relationship Table

| 联系 | 实体A | 实体B | 说明 |
|------|-------|-------|------|

Index Summary Table

| 表名 | 索引名 | 字段 | 类型 | 说明 |

Style Specifications

  • Header background: #4472C4 (dark blue)
  • Header text: White, bold, size 11
  • Odd rows: White #FFFFFF
  • Even rows: Light gray #E7E6E6
  • Data row text: SimSun, size 10
  • Borders: Black single line, 4 pt