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 f5f75ec commit 721f1f1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ to communication around the project.

The initial implementation of this package was funded by [Braintrust Data](https://braintrustdata.com/).

## Usage

```javascript
import {EditorView, basicSetup} from "codemirror"
import {yaml} from "@codemirror/lang-yaml"

const view = new EditorView({
parent: document.body,
doc: `name: Ferdinand\nage: 93`,
extensions: [basicSetup, yaml()]
})
```

## API Reference

<dl>
Expand All @@ -43,4 +56,4 @@ highlighting and indentation information.</p>
with an optional YAML &quot;frontmatter&quot; delimited by lines that
contain three dashes.</p>
</dd>
</dl>
</dl>
15 changes: 14 additions & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,23 @@ to communication around the project.

The initial implementation of this package was funded by [Braintrust Data](https://braintrustdata.com/).

## Usage

```javascript
import {EditorView, basicSetup} from "codemirror"
import {yaml} from "@codemirror/lang-yaml"

const view = new EditorView({
parent: document.body,
doc: `name: Ferdinand\nage: 93`,
extensions: [basicSetup, yaml()]
})
```

## API Reference

@yaml

@yamlLanguage

@yamlFrontmatter
@yamlFrontmatter

0 comments on commit 721f1f1

Please sign in to comment.