Skip to content

Commit

Permalink
Add npm installation instructions to README (#2197)
Browse files Browse the repository at this point in the history
People are confused on how to install and use
this library with npm and plain javascript.
People are especially confused about the
initialization part.

Adding this information to main README helps
out people who vist npm registry and want
get started quickly without diving deep
into the documentation.

Co-authored-by: Hendrig Sellik <[email protected]>
  • Loading branch information
hsellik and Hendrig Sellik authored Dec 8, 2023
1 parent d31a5a4 commit 563e43d
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,36 @@ And the best part? It's easy to customize to your needs!

## 🚀 Getting Started

Using MathLive is easy! Simply add a `<math-field>` tag to your page, and it
works just like a `<textarea>` or `<button>` element. You can manipulate the
mathfield using methods of the element and listen for events to be notified when
its internal state changes.
Using MathLive is easy! Simply add a `<math-field>` tag to your page. It
initializes automatically and works just like a `<textarea>` or `<button>`
element. You can manipulate the mathfield using methods of the element and
listen for events to be notified when its internal state changes.

`npm install mathlive`

```javascript
import 'mathlive';
```

```html
<!DOCTYPE html>
<html lang="en-US">
<head>
<script src="https://unpkg.com/mathlive"></script>
</head>
<body>
<math-field>f(x)=</math-field>
</body>
</html>
```

You can also add it using CDN
```html
<head>
<script src="https://unpkg.com/mathlive"></script>
</head>
```

Check documentation for [React](https://cortexjs.io/mathlive/guides/react/) and
[interaction with Mathfield](https://cortexjs.io/mathlive/guides/interacting/).

## 📖 Documentation

MathLive has an extensive set of documentation to help you get started,
Expand Down

0 comments on commit 563e43d

Please sign in to comment.