Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearer API documentation for Quill.import method #2939

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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