A modern rich-text editor based on TipTap with comprehensive extensions for document processing.
- @docen/tiptap-extensions - TipTap extensions with comprehensive TypeScript types
- @docen/export-docx - Export TipTap/ProseMirror content to Microsoft Word DOCX format
- @docen/import-docx - Import Microsoft Word DOCX files to TipTap/ProseMirror content
# Install with npm
$ npm install @docen/export-docx
# Install with yarn
$ yarn add @docen/export-docx
# Install with pnpm
$ pnpm add @docen/export-docximport { generateDOCX } from "@docen/export-docx";
import { writeFileSync } from "node:fs";
// Your TipTap/ProseMirror editor content
const content = {
type: "doc",
content: [
{
type: "paragraph",
content: [
{
type: "text",
marks: [{ type: "bold" }, { type: "italic" }],
text: "Hello, world!",
},
],
},
],
};
// Convert to DOCX and save to file
const docx = await generateDOCX(content, { outputType: "nodebuffer" });
writeFileSync("document.docx", docx);# Install with npm
$ npm install @docen/import-docx
# Install with yarn
$ yarn add @docen/import-docx
# Install with pnpm
$ pnpm add @docen/import-docximport { parseDOCX } from "@docen/import-docx";
import { readFileSync } from "node:fs";
// Read DOCX file
const buffer = readFileSync("document.docx");
// Parse DOCX to TipTap JSON
const content = await parseDOCX(buffer);
// Use in TipTap editor
editor.commands.setContent(content);- Node.js 18.x or higher
- pnpm 9.x or higher (recommended package manager)
- Git for version control
-
Clone the repository:
git clone https://github.com/DemoMacro/docen.git cd docen -
Install dependencies:
pnpm install
-
Development mode:
pnpm dev
-
Build all packages:
pnpm build
-
Test locally:
# Link the package globally for testing cd packages/export-docx pnpm link --global # Test in your project import { generateDOCX } from '@docen/export-docx';
pnpm dev # Development mode with watch
pnpm build # Build all packages
pnpm lint # Run code formatting and lintingWe welcome contributions! Here's how to get started:
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/docen.git cd docen -
Add upstream remote:
git remote add upstream https://github.com/DemoMacro/docen.git
-
Install dependencies:
pnpm install
-
Development mode:
pnpm dev
-
Test locally:
# Link the package globally for testing cd packages/export-docx pnpm link --global # Test your changes import { generateDOCX } from '@docen/export-docx';
- Code: Follow our project standards
- Test:
pnpm build && <test your extension> - Commit: Use conventional commits (
feat:,fix:, etc.) - Push: Push to your fork
- Submit: Create a Pull Request to upstream repository
This project follows core principles:
- TipTap Focus: Built specifically for TipTap/ProseMirror ecosystem
- Type Safety: Full TypeScript support with comprehensive types
- Modular Design: Each converter handles specific content types
- Extensible: Easy to add new content type converters
- Performance: Optimized for large documents and batch processing
- User Experience: Simple API with powerful configuration options
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Demo Macro