docx

Create and edit .docx files with formatting, tables, and images.

Updated Oct 10, 2024
One-click install
npx skills add https://github.com/distolma/dotfiles --skill docx-distolma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/distolma/dotfiles/tree/main/.agents/skills/docx
Command: npx skills add https://github.com/distolma/dotfiles --skill docx-distolma

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandoc, docx, LibreOffice, Poppler, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the creation, editing, and manipulation of Microsoft Word documents (.docx files), enabling professional document generation and efficient data handling.

Core Features & Use Cases

  • Document Creation: Generate new .docx files with custom formatting, tables, lists, images, and headers/footers using JavaScript.
  • Document Editing: Modify existing .docx files by unpacking, editing XML, and repacking, including accepting tracked changes.
  • Conversion: Convert between .doc and .docx formats, and extract content for other uses.
  • Use Case: Automatically generate a monthly performance report in .docx format, complete with a table of contents, specific styling, and embedded charts, based on data from another source.

Quick Start

Use the docx skill to create a new Word document with a title and a single paragraph.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I programmatically create a Word document with custom formatting, tables, and images?

To create a Word document programmatically, you can use JavaScript libraries like `docx-js` to generate .docx files with complex formatting, tables, lists, images, and headers/footers. This approach enables automated document creation with precise styling control.

Can I edit an existing .docx file by directly modifying its XML structure?

Yes, you can edit existing .docx files by unpacking the document, directly manipulating the underlying XML, and repacking it. This method supports advanced modifications like accepting tracked changes without relying on standard document editing interfaces.

What is the best way to convert legacy .doc files to the .docx format?

The best way to convert legacy .doc files to .docx format is by using conversion utilities like `pandoc` and `soffice` (LibreOffice). These tools facilitate reliable format conversion and allow you to extract content for other uses.

Do I need LibreOffice and Poppler installed to analyze and convert Word documents?

Yes, analyzing and converting Word documents effectively relies on dependencies like LibreOffice for conversion and Poppler for rendering. These tools work alongside `pandoc` and `docx` libraries to support full document manipulation and analysis.

How does unpacking and repacking XML work when accepting tracked changes in a Word document?

Unpacking and repacking XML to accept tracked changes involves extracting the .docx file, locating the specific XML nodes representing the revisions, programmatically accepting the changes, and repacking the file into a valid .docx format.

Can I automatically generate a monthly performance report in .docx format with a table of contents and embedded charts?

Yes, you can automatically generate a monthly performance report in .docx format complete with a table of contents, specific styling, and embedded charts. This is achieved by using JavaScript to programmatically generate the document based on external data.