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 10335e5 commit 39585df
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ 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"
import {html} from "@codemirror/lang-html"

const view = new EditorView({
parent: document.body,
doc: `<!doctype html>\n<title>HTML</title>`,
extensions: [basicSetup, html()]
})
```

## API Reference

<dl>
Expand Down
13 changes: 13 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ 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"
import {html} from "@codemirror/lang-html"

const view = new EditorView({
parent: document.body,
doc: `<!doctype html>\n<title>HTML</title>`,
extensions: [basicSetup, html()]
})
```

## API Reference

@html
Expand Down

0 comments on commit 39585df

Please sign in to comment.