Skip to content

Commit 86f3699

Browse files
committed
Add a usage section to readme
1 parent b3be7cd commit 86f3699

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,19 @@ We aim to be an inclusive, welcoming community. To make that explicit,
1818
we have a [code of
1919
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
2020
to communication around the project.
21+
22+
## Usage
23+
24+
```javascript
25+
import {EditorView, basicSetup} from "codemirror"
26+
27+
const view = new EditorView({
28+
parent: document.body,
29+
doc: "Hello",
30+
extensions: [basicSetup /* ... */]
31+
})
32+
```
33+
34+
This sets up a basic code editor containing the word "Hello". You'll
35+
usually want to add at least a [language
36+
mode](https://codemirror.net/#languages) to your configuration.

0 commit comments

Comments
 (0)