htr-0.5.16 has been yanked.
htr
Fast html to react jsx transformer
Getting Started
This project transforms html into react jsx markup.
This helps when using find and replace tools when you scrape content getting raw html and need a way to convert it back to the form it would be in a valid React codebase.
[]
= "0.5.4"
extern crate htr;
use convert_props_react;
extern crate htr;
use convert_to_react;
/// convert html to react component
Benchmark Results
transform
64gb apple silicon |
parse |
|---|---|
convert_props_react: simultaneous 1000 samples |
4.86 us (✅ 1.00x) |
convert_props_react: concurrent10x 1000 samples |
45.130 us (✅ 10.00x) |
About
This project uses BTrees and parses the html with the order sorted before lookup for speed.
You can combine this project with html-parser to convert elements into React ready components.
An example of this being used with ripgrep to perform search and replace from scraped content to find exactly where in the codebase it would be, the react way.
TODO
- inline symbols with backticks