@tin.so/core 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -2
- package/dist/index-CtUX1lFe.d.mts +1076 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -0
- package/dist/node.d.mts +21 -0
- package/dist/node.mjs +31 -0
- package/dist/src-BdXa6abO.mjs +8546 -0
- package/fonts/commit-mono/LICENSE.txt +90 -0
- package/fonts/commit-mono/commit-mono-400-italic.ttf +0 -0
- package/fonts/commit-mono/commit-mono-400.ttf +0 -0
- package/fonts/commit-mono/commit-mono-700.ttf +0 -0
- package/fonts/fira-code/LICENSE.txt +93 -0
- package/fonts/fira-code/fira-code-400.ttf +0 -0
- package/fonts/fira-code/fira-code-700.ttf +0 -0
- package/fonts/geist-mono/LICENSE.txt +93 -0
- package/fonts/geist-mono/geist-mono-400.ttf +0 -0
- package/fonts/geist-mono/geist-mono-700.ttf +0 -0
- package/fonts/google-sans-code/LICENSE.txt +93 -0
- package/fonts/google-sans-code/google-sans-code-400-italic.ttf +0 -0
- package/fonts/google-sans-code/google-sans-code-400.ttf +0 -0
- package/fonts/google-sans-code/google-sans-code-700.ttf +0 -0
- package/fonts/ibm-plex-mono/LICENSE.txt +93 -0
- package/fonts/ibm-plex-mono/ibm-plex-mono-500-italic.ttf +0 -0
- package/fonts/ibm-plex-mono/ibm-plex-mono-500.ttf +0 -0
- package/fonts/ibm-plex-mono/ibm-plex-mono-700.ttf +0 -0
- package/fonts/inter/LICENSE.txt +93 -0
- package/fonts/inter/inter-400.ttf +0 -0
- package/fonts/inter/inter-500.ttf +0 -0
- package/fonts/jetbrains-mono/LICENSE.txt +93 -0
- package/fonts/jetbrains-mono/jetbrains-mono-500-italic.ttf +0 -0
- package/fonts/jetbrains-mono/jetbrains-mono-500.ttf +0 -0
- package/fonts/jetbrains-mono/jetbrains-mono-700.ttf +0 -0
- package/fonts/roboto-mono/LICENSE.txt +93 -0
- package/fonts/roboto-mono/roboto-mono-400-italic.ttf +0 -0
- package/fonts/roboto-mono/roboto-mono-400.ttf +0 -0
- package/fonts/roboto-mono/roboto-mono-700.ttf +0 -0
- package/fonts/source-code-pro/LICENSE.txt +93 -0
- package/fonts/source-code-pro/source-code-pro-400-italic.ttf +0 -0
- package/fonts/source-code-pro/source-code-pro-400.ttf +0 -0
- package/fonts/source-code-pro/source-code-pro-700.ttf +0 -0
- package/fonts/space-mono/LICENSE.txt +93 -0
- package/fonts/space-mono/space-mono-400-italic.ttf +0 -0
- package/fonts/space-mono/space-mono-400.ttf +0 -0
- package/fonts/space-mono/space-mono-700.ttf +0 -0
- package/package.json +57 -3
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tin.so/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Renders code images from a JSON spec. The pipeline is `spec → Shiki tokens → layout → SVG → PNG` and needs no browser: the layout places every character on a monospace grid with the metrics of the bundled fonts, and [resvg](https://github.com/linebender/resvg) (WebAssembly) rasterizes the SVG. The same code runs in Node and in the browser.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { render } from "@tin.so/core/node";
|
|
7
|
+
|
|
8
|
+
const png = await render({
|
|
9
|
+
theme: "vercel",
|
|
10
|
+
windows: [
|
|
11
|
+
{
|
|
12
|
+
titleBar: false,
|
|
13
|
+
tabs: true,
|
|
14
|
+
split: "row",
|
|
15
|
+
panes: [
|
|
16
|
+
{ title: "main.ts", code: 'import plans from "./plans.toml";' },
|
|
17
|
+
{ title: "plans.toml", code: "[free]\nprice = 0" },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Scripts
|
|
25
|
+
|
|
26
|
+
- `pnpm port-themes` fetches the ray.so themes at a pinned commit and writes `src/themes/*.json`.
|
|
27
|
+
- `pnpm download-fonts` downloads the fonts to `fonts/` and writes their metrics to `src/fonts/fonts.generated.json`.
|
|
28
|
+
|
|
29
|
+
## Attribution
|
|
30
|
+
|
|
31
|
+
- The themes, the token colors and the frame styles come from [ray.so](https://github.com/raycast/ray-so) (MIT).
|
|
32
|
+
- The fonts are under the SIL Open Font License, except Commit Mono (MIT). Each font directory contains its license.
|
|
33
|
+
- The file icon is from [Lucide](https://lucide.dev) (ISC), the language icons from [Simple Icons](https://simpleicons.org) (CC0).
|