Skip to content

Commit

Permalink
Add a usage section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Dec 30, 2024
1 parent 3739cff commit e3c2aea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

## Usage

```javascript
import {EditorView, basicSetup} from "codemirror"
import {wast} from "@codemirror/lang-wast"

const view = new EditorView({
parent: document.body,
doc: `(call $log (i32.const 0) (i32.const 13))`,
extensions: [basicSetup, wast()]
})
```

## API Reference

<dl>
Expand Down
13 changes: 13 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

## Usage

```javascript
import {EditorView, basicSetup} from "codemirror"
import {wast} from "@codemirror/lang-wast"

const view = new EditorView({
parent: document.body,
doc: `(call $log (i32.const 0) (i32.const 13))`,
extensions: [basicSetup, wast()]
})
```

## API Reference

@wast
Expand Down

0 comments on commit e3c2aea

Please sign in to comment.