Skip to content

Commit b7bc816

Browse files
committed
Add a usage section to readme
1 parent ba9cf86 commit b7bc816

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
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 {java} from "@codemirror/lang-java"
27+
28+
const view = new EditorView({
29+
parent: document.body,
30+
doc: `public static void main(String[] args) {}`,
31+
extensions: [basicSetup, java()]
32+
})
33+
```
34+
2235
## API Reference
2336

2437
<dl>

src/README.md

Lines changed: 13 additions & 0 deletions
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 {java} from "@codemirror/lang-java"
27+
28+
const view = new EditorView({
29+
parent: document.body,
30+
doc: `public static void main(String[] args) {}`,
31+
extensions: [basicSetup, java()]
32+
})
33+
```
34+
2235
## API Reference
2336

2437
@java

0 commit comments

Comments
 (0)