diff --git a/README.md b/README.md index cfd74975..2853173c 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,13 @@ cargo install --locked --git https://github.com/Myriad-Dreamin/typst.ts typst-ts Or Download the latest release from [GitHub Releases](https://github.com/Myriad-Dreamin/typst.ts/releases). -### Example: Render Typst document in browser (build from source with/without wasm-pack) +### Documentation + +See [Documentation](https://myriad-dreamin.github.io/typst.ts/cookery). + +### Build from source and check + +Note: you could build from source with/without wasm-pack. Note: see [Troubleshooting WASM Build](docs/troubleshooting-wasm-build.md) for (especially) **Arch Linux** users. @@ -103,11 +109,11 @@ And open your browser to `http://localhost:20810/`. You can also run `yarn run build:core` instead of `npx turbo run build` to build core library (`@myriaddreamin/typst.ts`) and avoid building the WASM modules from source. -### Example: generate documentation site for packages developers. + ### Concept: Precompiler diff --git a/packages/compiler/README.md b/packages/compiler/README.md index 155178b0..c43a7925 100644 --- a/packages/compiler/README.md +++ b/packages/compiler/README.md @@ -2,5 +2,5 @@ The compiler can run in both the browser and node.js. See documentation for details: -- [Serverless Compiler](https://myriad-dreamin.github.io/typst.ts/cookery/guide/compiler/serverless.html) -- [Compiler for Node.js](https://myriad-dreamin.github.io/typst.ts/cookery/guide/compiler/node.html) +- [Get Started](https://myriad-dreamin.github.io/typst.ts/cookery/get-started.html) +- [Compiler interfaces](https://myriad-dreamin.github.io/typst.ts/cookery/guide/compilers.html) diff --git a/packages/renderer/README.md b/packages/renderer/README.md index 9aad7c17..6abc0d7e 100644 --- a/packages/renderer/README.md +++ b/packages/renderer/README.md @@ -1,3 +1,5 @@ # typst-ts-renderer -See [Typst.ts](https://github.com/Myriad-Dreamin/typst.ts) +See [Typst.ts](https://github.com/Myriad-Dreamin/typst.ts) and documentation: + +- [Get Started](https://myriad-dreamin.github.io/typst.ts/cookery/get-started.html) diff --git a/packages/typst.ts/README.md b/packages/typst.ts/README.md index c3514b0f..6bb65d3b 100644 --- a/packages/typst.ts/README.md +++ b/packages/typst.ts/README.md @@ -1,8 +1,20 @@ # Typst.ts -## Usage +Usage: ```typescript -import { createTypstRenderer } from '@myriaddreamin/typst.ts'; -const renderer = createTypstRenderer(); +import { $typst } from '@myriaddreamin/typst.ts/dist/esm/contrib/snippet.mjs'; +console.log( + ( + await $typst.svg({ + mainContent: 'Hello, typst!', + }) + ).length, +); +// :-> 7317 ``` + +See [Typst.ts](https://github.com/Myriad-Dreamin/typst.ts) and documentation for details: + +- [Get Started](https://myriad-dreamin.github.io/typst.ts/cookery/get-started.html) +- [Compiler interfaces](https://myriad-dreamin.github.io/typst.ts/cookery/guide/compilers.html)