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 24e43e6 commit 2e7fa06
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 {markdown} from "@codemirror/lang-markdown"

const view = new EditorView({
parent: document.body,
doc: `*CodeMirror* Markdown \`mode\``,
extensions: [basicSetup, markdown()]
})
```

## 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 {markdown} from "@codemirror/lang-markdown"

const view = new EditorView({
parent: document.body,
doc: `*CodeMirror* Markdown \`mode\``,
extensions: [basicSetup, markdown()]
})
```

## API Reference

@markdown
Expand Down

0 comments on commit 2e7fa06

Please sign in to comment.