Skip to content

lrangell/plate-docx-deserializer

Repository files navigation

plate-docx-deserializer

A (WIP) docx to Plate deserializer. Written in Gleam, compiled to JavaScript.

Converts Microsoft Word documents to Plate editor format, preserving formatting and structure.

Installation

npm install plate-docx-deserializer
# or
pnpm add plate-docx-deserializer

Usage

import { convertDocx } from "plate-docx-deserializer";

// Pass a Uint8Array of the DOCX file
const plateNodes = await convertDocx(uint8Array);

// Use the nodes in your Plate editor

What it converts

  • Text formatting (bold, italic, underline, strikethrough)
  • Paragraphs and headings
  • Lists (numbered, bulleted)
  • Text alignment
  • Basic styles from Word

Development

# Install dependencies
pnpm install

# Run tests
gleam test

# Build library
pnpm build

# Run example app
pnpm dev

Example

Live demo

See examples/basic-editor/ for the source code.

About

DOCX to Slate.js converter written in Gleam

Resources

Stars

Watchers

Forks

Packages

No packages published