https://github.com/loopystudios/replace_html
A simple, minimal crate to replace an HTML element with new HTML.
https://github.com/loopystudios/replace_html
Last synced: 4 months ago
JSON representation
A simple, minimal crate to replace an HTML element with new HTML.
- Host: GitHub
- URL: https://github.com/loopystudios/replace_html
- Owner: loopystudios
- License: apache-2.0
- Created: 2024-04-15T19:16:50.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-15T20:28:08.000Z (about 2 years ago)
- Last Synced: 2025-02-01T08:33:28.842Z (over 1 year ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Replace HTML
**A simple, minimal crate to replace HTML in wasm32 environments.**
[](https://discord.gg/zrjnQzdjCB)
[](#license)
[](https://github.com/loopystudios/replace_html/actions)
[](https://deps.rs/repo/github/loopystudios/replace_html)
[](https://crates.io/crates/replace_html)
[](https://docs.rs/replace_html)
Quickstart to run demo:
- **Web**
```shell
# Make sure the Rust toolchain supports the wasm32 target
rustup target add wasm32-unknown-unknown
# Install `wasm-server-runner` for the example
cargo install wasm-server-runner
cargo run --target wasm32-unknown-unknown --example simple
```
There is also a web demo [available here](https://loopystudios.github.io/replace_html).
## Usage
```rust
#[cfg(target_arch = "wasm32")]
fn main() {
replace_html::replace_body("Your platform is not supported!").unwrap();
}
#[cfg(not(target_arch = "wasm32"))]
fn main() {
// Proceed to run your application...
}
```
## Community
All Loopy projects and development happens in the [Loopy Discord](https://discord.gg/zrjnQzdjCB). The discord is open to the public.
Contributions are welcome by pull request. The [Rust code of conduct](https://www.rust-lang.org/policies/code-of-conduct) applies.
## License
Licensed under either of
- Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or )
- MIT license
([LICENSE-MIT](LICENSE-MIT) or )
at your option
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.