@flux-lang/render-html 0.1.12 → 0.1.14
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 +47 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @flux-lang/render-html
|
|
2
|
+
|
|
3
|
+
1) **What this package is**
|
|
4
|
+
HTML/CSS renderer for Flux RenderDocumentIR.
|
|
5
|
+
|
|
6
|
+
2) **When you use it**
|
|
7
|
+
Use it when you need to turn Render IR into HTML/CSS for the viewer or export pipelines.
|
|
8
|
+
|
|
9
|
+
3) **Install**
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @flux-lang/render-html
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
4) **Basic usage**
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { parseDocument, renderDocumentIR } from "@flux-lang/core";
|
|
19
|
+
import { renderHtml } from "@flux-lang/render-html";
|
|
20
|
+
|
|
21
|
+
const src = `
|
|
22
|
+
document {
|
|
23
|
+
meta { version = "0.2.0"; }
|
|
24
|
+
body { page p1 { text t1 { content = "Hello"; } } }
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const doc = parseDocument(src);
|
|
29
|
+
const ir = renderDocumentIR(doc);
|
|
30
|
+
const { html, css } = renderHtml(ir);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
5) **Reference**
|
|
34
|
+
- **Entry point**: `renderHtml`, `renderSlotMap` (see `src/index.ts`)
|
|
35
|
+
|
|
36
|
+
6) **How it relates to IR/runtime**
|
|
37
|
+
It consumes `RenderDocumentIR` and does not advance runtime state itself.
|
|
38
|
+
|
|
39
|
+
7) **Gotchas & troubleshooting**
|
|
40
|
+
- Use `renderDocumentIR` (not `renderDocument`) to get stable node IDs required for slot patching.
|
|
41
|
+
|
|
42
|
+
8) **Versioning / compatibility notes**
|
|
43
|
+
TBD / Not yet implemented.
|
|
44
|
+
|
|
45
|
+
9) **Links**
|
|
46
|
+
- Root Flux manual: [`../../README.md`](../../README.md)
|
|
47
|
+
- Source: [`src/`](src/)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flux-lang/render-html",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "HTML/CSS renderer for Flux RenderDocumentIR.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Suarez-Solis",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"hyphenation.en-us": "^0.2.1",
|
|
24
24
|
"hypher": "^0.2.5",
|
|
25
|
-
"@flux-lang/core": "^0.1.
|
|
25
|
+
"@flux-lang/core": "^0.1.14"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "^5.6.0",
|