docx

Create, edit, and analyze Word documents using docx-js and Python.

34|1|Updated Apr 16, 2012
One-click install
npx skills add https://github.com/meowgorithm/dotfiles --skill docx-meowgorithm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/meowgorithm/dotfiles/tree/main/crush/skills/docx
Command: npx skills add https://github.com/meowgorithm/dotfiles --skill docx-meowgorithm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires docx, pandoc, libreoffice, poppler, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill streamlines the creation, editing, and analysis of Word documents, allowing you to quickly produce professional documents with minimal effort.

Core Features & Use Cases

  • DOCX Creation: Generate new Word documents with JavaScript and docx-js, including formatting like tables of contents, headings, and page numbers.
  • Editing Existing Documents: Edit Word documents directly through XML manipulation, including tracked changes and comments.
  • Data Extraction and Conversion: Extract text and convert .doc files to .docx format.
  • Use Case: Imagine you need to create a detailed report with a table of contents. Use this Skill to generate the document structure using JavaScript and then edit the content and add tracked changes through XML manipulation.

Quick Start

To create a new Word document, run the following JavaScript code:

const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun, Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink, TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType, VerticalAlign, PageNumber, PageBreak } = require('docx');
const doc = new Document({ sections: [{ children: [/* content */] }] });
Packer.toBuffer(doc).then(buffer => fs.writeFileSync("doc.docx", buffer));

Frequently Asked Questions about docx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Word document creation with JavaScript?

Automate Word document creation using JavaScript and docx-js to generate professional files with tables of contents, headings, and page numbers. This approach builds the document structure programmatically, outputting a formatted DOCX file directly from your code.

How do I edit an existing DOCX file and add tracked changes?

Edit existing DOCX files and add tracked changes through direct XML manipulation using Python. This method modifies the underlying document structure, allowing granular updates and comments without altering the original formatting.

What is the best way to extract text and convert .doc to .docx?

Extract text and convert .doc to .docx format using integrated tools like pandoc and libreoffice. This conversion process modernizes older documents, making them compatible with advanced data extraction workflows.

Do I need Python and JavaScript to generate and edit Word documents?

You need both JavaScript with docx-js for document generation and Python for XML manipulation to fully utilize Word document automation. This dual-stack approach handles both structural creation and granular editing.

Does docx-js support adding page numbers and tables of contents?

Docx-js supports adding page numbers, tables of contents, headings, and custom formatting during Word document creation. These features allow you to generate structured, professional reports programmatically.

Can I extract data directly from Word documents without opening them?

Extract data directly from Word documents by parsing the file contents with Python and poppler. This automated data extraction retrieves text and structural information without needing to manually open the file.