Skip to content

Commit

Permalink
Improve documentation for Syntax module
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Feb 12, 2024
1 parent 3029eeb commit f7ac944
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/website/content/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,15 @@ import Link from 'quill/formats/link';
// Or const Link = Quill.import('formats/link');
```

### Styles

Quill's npm package also comes with the stylesheets for the core and themes, just like the CDN build.
Those stylesheets live in the `dist` directory.

You can import them in your JavaScript files if you have a proper bundler setup.

```js
import "quill/dist/quill.core.css";
```

Refer to [webpack-example](https://github.com/quilljs/webpack-example) for a sample project that uses Quill in a webpack project.
2 changes: 2 additions & 0 deletions packages/website/content/docs/modules/syntax.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ quill.setContents(
`}}
/>

### Use npm Package

If you install highlight.js as an npm package and don't want to expose it to `window`, you need to pass it to syntax module as an option:

```js
Expand Down
1 change: 0 additions & 1 deletion packages/website/src/components/Sandpack.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
SandpackCodeEditor,
SandpackFileExplorer,
SandpackPreview,
Sandpack as RawSandpack,
useSandpack,
} from '@codesandbox/sandpack-react';
import { useEffect, useState } from 'react';
Expand Down

0 comments on commit f7ac944

Please sign in to comment.