Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpapercut committed May 3, 2024
1 parent 918d368 commit 0687e57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ You can load this library either by using a script tag, or installing it with np

### Script tag (simple usage)
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].6/dist/wypst.min.css" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected].6/dist/wypst.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].8/dist/wypst.min.css" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/wypst.min.js" crossorigin="anonymous"></script>

<script>
wypst.initialize().then(() => {
Expand All @@ -33,6 +33,8 @@ await wypst.initialize(wasm);
wypst.renderToString("x + y"); // Test it out!
```

Keep in mind that you will probably need to tell your bundler how to load a `.wasm` file. If you have difficulties you can open an issue.

### Rendering Typst Math
To render a Typst math expression, you can use either `render` or `renderToString`, as the example below shows:
```javascript
Expand Down

0 comments on commit 0687e57

Please sign in to comment.