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 b3be7cd commit 86f3699
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ We aim to be an inclusive, welcoming community. To make that explicit,
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"

const view = new EditorView({
parent: document.body,
doc: "Hello",
extensions: [basicSetup /* ... */]
})
```

This sets up a basic code editor containing the word "Hello". You'll
usually want to add at least a [language
mode](https://codemirror.net/#languages) to your configuration.

0 comments on commit 86f3699

Please sign in to comment.