Skip to content

Commit 4bbe69e

Browse files
committed
Add a usage section to readme
1 parent 32fbdef commit 4bbe69e

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 {rust} from "@codemirror/lang-rust"
27+
28+
const view = new EditorView({
29+
parent: document.body,
30+
doc: `println!("Hello World!");`,
31+
extensions: [basicSetup, rust()]
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 {rust} from "@codemirror/lang-rust"
27+
28+
const view = new EditorView({
29+
parent: document.body,
30+
doc: `println!("Hello World!");`,
31+
extensions: [basicSetup, rust()]
32+
})
33+
```
34+
2235
## API Reference
2336

2437
@rust

0 commit comments

Comments
 (0)