docxlisted
Install: claude install-skill Everfern-AI/Everfern
# DOCX Creation, Editing, and Analysis in EverFern
## Overview
A .docx file is a ZIP archive containing XML files. In EverFern, you use native Windows tools and Python libraries directly to interact with them. You MUST use Windows paths (e.g., `C:\path\to\file.docx`).
## Quick Reference
| Task | Approach |
|------|----------|
| Read/analyze content | `pandoc` or `python-docx` |
| Create new document | Use `python-docx` |
| Edit existing document | Use `python-docx` |
### Reading Content
```powershell
# Text extraction
pandoc "C:\path\to\document.docx" -o "C:\path\to\output.md"
```
---
## Python `python-docx` (Preferred Method)
The primary and safest way to manipulate Word documents in Python is the `python-docx` library.
Install it if necessary: `pip install python-docx`
### Creating a New Document
```python
from docx import Document
from docx.shared import Inches, Pt, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
doc = Document()
# Add Title
title = doc.add_heading('Document Title', 0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
# Add Paragraph
p = doc.add_paragraph('This is a paragraph with ')
p.add_run('bold').bold = True
p.add_run(' and ')
p.add_run('italic').italic = True
p.add_run(' text.')
# Add a styled heading
heading = doc.add_heading('Section 1', level=1)
run = heading.runs[0]
run.font.color.rgb = RGBColor(0x42, 0x24, 0xE9)
# Add List
doc.add_paragraph('First item in bulleted list', style='List Bullet')
doc.add_paragraph('First item in numb