Skip to content

Commit

Permalink
Update extension API documentation to fix slab#2938
Browse files Browse the repository at this point in the history
Make it more clear that `Quill.import` is just the read to `Quill.register`'s write, and that the relationship between Quill source code and an object's "path" is simply a convention.

I wrote this assuming that `Quill.imports` is internal API but since it was already mentioned elsewhere in the public docs it seemed fitting to share a similar tip here.
  • Loading branch information
natevw committed Feb 20, 2020
1 parent 0c3b286 commit dfa6b78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/docs/api/extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Quill.debug('info');

### import

Static method returning Quill library, format, module, or theme. In general the path should map exactly to Quill source code directory structure. Unless stated otherwise, modification of returned entities may break required Quill functionality and is strongly discouraged.
Static method returning a library, format, module, or theme previously registered via [`Quill.register`](/docs/api/#register). Quill itself registers nearly all of its own objects and for these the path generally matches the Quill source code directory structure. Unless stated otherwise, modification of returned entities may break required Quill functionality and is strongly discouraged.

(As a debugging aid, you can see all entries at a given time via `console.log(Quill.imports)`. This `.imports` field is unsupported — you are expected to use only the documented `.import()` and `.register()` methods in your code!)

**Methods**

Expand All @@ -35,6 +37,8 @@ var Delta = Quill.import('delta');
var Toolbar = Quill.import('modules/toolbar');
var Link = Quill.import('formats/link');
// Similar to ES6 syntax `import Link from 'quill/formats/link';`
// Note that non-default exports are typically registered as subpaths.
var BlockEmbed = Quill.import('blots/block/embed');
```

### register
Expand Down

0 comments on commit dfa6b78

Please sign in to comment.