Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lensvol/mimicui
Small tool to convert HTML into JS code.
https://github.com/lensvol/mimicui
Last synced: about 2 months ago
JSON representation
Small tool to convert HTML into JS code.
- Host: GitHub
- URL: https://github.com/lensvol/mimicui
- Owner: lensvol
- License: mit
- Created: 2022-12-28T14:43:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-27T08:56:18.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T04:08:35.619Z (8 months ago)
- Language: Rust
- Size: 45.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mimicui
[![Build status](https://github.com/lensvol/mimicui/actions/workflows/build_checks.yaml/badge.svg)](https://github.com/lensvol/mimicui/actions/workflows/build_checks.yaml)
[![Code Coverage](https://codecov.io/gh/lensvol/mimicui/branch/main/graph/badge.svg?token=9UQH8NT0RU)](https://codecov.io/gh/lensvol/mimicui)
[![License](https://img.shields.io/github/license/lensvol/mimicui)](https://github.com/lensvol/mimicui/blob/master/LICENSE)Toy HTML-to-JS converter with both CLI and WASM frontends.
[**Try it here!**](https://lensvol.github.io/mimicui)
## Example output
```javascript
function createMimic() {
const root = document.createElement('div');const paragraph = document.createElement('p');
paragraph.style.cssText = 'sexy';const text = document.createTextNode('Hello, world!');
root.appendChild(paragraph);
paragraph.appendChild(text);
return root;
}
```## Usage
* Convert HTML code stored in the HTML file:
```shell
mimicui
```* Convert HTML read from STDIN:
```shell
curl https://test.host/1.html | mimicui -
```
## Development### Compiling from source
```shell
cargo build --target release
```### Compiling into WASM module
```shell
wasm-pack build --target web```
Output will be put into the `pkg/` directory.