Skip to content

Commit

Permalink
readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
calumk committed Nov 17, 2023
1 parent a14b206 commit d77d519
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ https://cdn.jsdelivr.net/npm/@calumk/codecup
## Usage

```js
import codecup from 'codecup';
import codecup from '@calumk/codecup';

const flask = new codecup('#my-selector', { language: 'js' });
const cup = new codecup('#my-selector', { language: 'js' });
```
You can also pass a DOM element instead of a selector:
```js
import codecup from 'codecup';

const editorElem = document.getElementById('editor');
const flask = new codecup(editorElem, { language: 'js' });
const cup = new codecup(editorElem, { language: 'js' });
```
Usage with Shadow DOM:
```js
import codecup from 'codecup';
...
const shadowElem = this.shadowRoot.querySelector('#editor');
const flask = new codecup(shadowElem, { language: 'js', styleParent: this.shadowRoot });
const cup = new codecup(shadowElem, { language: 'js', styleParent: this.shadowRoot });
```
### Listening for changes in editor

Expand Down

0 comments on commit d77d519

Please sign in to comment.