From b60500e66efc0b000908ed1af66e347c7e19c831 Mon Sep 17 00:00:00 2001 From: 0xpapercut <0xpapercut@gmail.com> Date: Mon, 5 Feb 2024 23:25:31 +0100 Subject: [PATCH] Update README.md --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee3ec41..85dee42 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,25 @@ Typst math typesetting for the web. ## Getting started -> TODO \ No newline at end of file +### Installation +Install wypst with npm: +```bash +npm install wypst +``` +### Importing +You can import wypst as an ECMAScript module: +```javascript +import wypst from 'wypst'; +``` +### Rendering Typst Math +To render a Typst math expression, you can use either `render` or `renderToString`, as the example below shows: +```javascript +wypst.render('sum_(n >= 1) 1/n^2 = pi^2/6', element); // Renders into the HTML element +wypst.renderToString('sum_(n >= 1) 1/n^2 = pi^2/6'); // Renders into an HTML string +``` + +## Contributing +> TODO + +## Disclaimer +As of now wypst is very experimental, so you may encounter lots of bugs. I expect to have most fixed by mid March.