|
Download tasks/data/reverse/a11ywatch__htr.ce010e1/environment/docs/cli.md from Lego-X/ProgramGen: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/datasets/Lego-X/ProgramGen/resolve/main/tasks/data/reverse/a11ywatch__htr.ce010e1/environment/docs/cli.md
- Command line
-
hf download hf://datasets/Lego-X/ProgramGen/tasks/data/reverse/a11ywatch__htr.ce010e1/environment/docs/cli.md
-
curl -L -o cli.md https://huggingface.co/datasets/Lego-X/ProgramGen/resolve/main/tasks/data/reverse/a11ywatch__htr.ce010e1/environment/docs/cli.md
1.24 kB
htr CLI usage
The CLI usage of the HTML to React transform.
Install
cargo install htr_cli
Usage
Transform props to React (attributes and inline styles are converted, the HTML structure is preserved):
htr transform --html '<div class="something" for="mystuff" tabindex="2" style="color: white; background-color: black">'
Output:
<div className="something" htmlFor="mystuff" tabIndex="2" style={{color: "white", backgroundColor: "black"}}>
Transform to a full React component (pass a component name):
htr transform --html '<div class="something" for="mystuff" tabindex="2" style="color: white; background-color: black">' --component-name 'Main'
Flags
| Flag | Description |
|---|---|
--html |
Raw HTML input to transform (required). |
--component-name |
Component name; when provided, output is a full React component instead of transformed props/markup only. |
Subcommands
transform— transform HTML input to React JSX (props-only by default, or a full component when--component-nameis supplied).