Convert content in Word documents into professional table formats, supporting 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 titles that need beautification, such as:
3.1 实体识别→ Create an entity attribute table3.2 实体间联系→ Create a relationship table5.2 索引优化设计→ Create an index summary table
3. Create tables
Use scripts/create_table.py to create tables; refer to the script template below.
4. Apply styles
Use consistent styles:
- Header: dark blue background (#4472C4) + white bold text
- Data rows: alternating white/light gray 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 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