0.3.1 • Published 7 years ago

@gzzhanghao/docx2quill v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

docx2quill

Convert DocX to Quill Delta.

This package is under heavy development, use it at your own risk

Usage

import docx2Quill from '@gzzhanghao/docx2quill'

docx2Quill(docxBuffer, {

  /**
   * Custom image processor
   */
  async processImage(parser, filePath, size) {
    parser.delta = parser.delta.insert({
      image: await uploadImage(await parser.zip.file(filePath).async('nodebuffer'))
    }, {
      width: size.width,
      height: size.height,
    })
  },

  /**
   * Report for item not found error
   */
  notfoundError(type, id) {
    // type: number | abstract number | level | relationship | style
  },

}).then(delta => {

  // delta: Quill Delta
})
0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.10

7 years ago