Skip to content

Latest commit

 

History

History
82 lines (68 loc) · 2.79 KB

File metadata and controls

82 lines (68 loc) · 2.79 KB

@flux-lang/render-html

@flux-lang/render-html version @flux-lang/render-html stable channel @flux-lang/render-html canary channel License Maintained status

  1. What this package is HTML/CSS renderer for Flux RenderDocumentIR.

  2. When you use it Use it when you need to turn Render IR into HTML/CSS for the viewer or export pipelines.

  3. Install

pnpm add @flux-lang/render-html
  1. Basic usage
import { parseDocument, renderDocumentIR } from "@flux-lang/core";
import { renderHtml } from "@flux-lang/render-html";

const src = `
  document {
    meta { version = "0.2.0"; }
    body { page p1 { text t1 { content = "Hello"; } } }
  }
`;

const doc = parseDocument(src);
const ir = renderDocumentIR(doc);
const { html, css } = renderHtml(ir);
  1. Reference
  • Entry point: renderHtml, renderSlotMap (see src/index.ts)
  1. How it relates to IR/runtime It consumes RenderDocumentIR and does not advance runtime state itself.

  2. Gotchas & troubleshooting

  • Use renderDocumentIR (not renderDocument) to get stable node IDs required for slot patching.
  1. Versioning / compatibility notes TBD / Not yet implemented.

  2. Links