Skip to content

Commit b994686

Browse files
committed
Add a usage section to readme
1 parent 1d8e74b commit b994686

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ we have a [code of
1919
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
2020
to communication around the project.
2121

22+
## Usage
23+
24+
```javascript
25+
import {EditorView, basicSetup} from "codemirror"
26+
import {javascript} from "@codemirror/lang-javascript"
27+
28+
const view = new EditorView({
29+
parent: document.body,
30+
doc: `console.log("Hello world")`,
31+
extensions: [basicSetup, javascript()]
32+
})
33+
```
34+
2235
## API Reference
2336

2437
<dl>

src/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ we have a [code of
1919
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
2020
to communication around the project.
2121

22+
## Usage
23+
24+
```javascript
25+
import {EditorView, basicSetup} from "codemirror"
26+
import {javascript} from "@codemirror/lang-javascript"
27+
28+
const view = new EditorView({
29+
parent: document.body,
30+
doc: `console.log("Hello world")`,
31+
extensions: [basicSetup, javascript()]
32+
})
33+
```
34+
2235
## API Reference
2336

2437
@javascript

0 commit comments

Comments
 (0)