Eleventy Plugin Docx screenshot

Eleventy Plugin Docx

Author Avatar Theme by Larryhudson
Updated: 6 Apr 2022
15 Stars

Use Word documents as Eleventy input

Overview

The eleventy-plugin-docx is an innovative tool designed for users of Eleventy who want to seamlessly integrate Microsoft Word .docx documents into their static sites. This powerful plugin leverages the mammoth.js library to convert .docx files into HTML, allowing for rich content that can be easily manipulated and styled. Whether you’re publishing reports, articles, or documentation, this plugin enhances your workflow by making Word documents accessible directly within your web project.

With its additional capabilities for customization through cheerio, users can refine the output HTML with familiar jQuery-like syntax. This enables greater control over the presentation of your documents. Additionally, the plugin is compatible with Eleventy 1.0.0 beta 8 and newer, making it a great choice for those looking to use the latest features in their projects.

Features

  • HTML Conversion: Easily convert .docx files to HTML using the mammoth.js library for better web integration.
  • Custom Transformer Function: Utilize cheerio for a jQuery-like syntax to tailor the HTML output according to your needs.
  • Flexible Layout Options: Configure your global layout in the Eleventy config file and customize layouts for specific directories.
  • Directory-Based Configurations: Override default configurations for individual directories, allowing tailored settings for specific documents.
  • Global Layout Customization: Control whether to use a global layout or specify layouts for individual directories for more nuanced design control.
  • Integration with Other Plugins: Works well alongside eleventy-plugin-render to enable rendering Word document content directly within other templates.
  • Straightforward Installation: Simple integration into your Eleventy project using npm, making setup quick and efficient.