Crates.io | html-mumu |
lib.rs | html-mumu |
version | 0.1.2 |
created_at | 2025-08-15 15:49:55.35547+00 |
updated_at | 2025-08-15 15:49:55.35547+00 |
description | HTML manipulation and tools plugin for the Lava language |
homepage | https://lava.nu11.uk |
repository | https://gitlab.com/tofo/mumu-html |
max_upload_size | |
id | 1797021 |
size | 30,890 |
HTML manipulation and extraction plugin for the Lava language (MuMu runtime).
!license](./LICENSE)
** mumu-html ** provides fast, simple HTML text extraction utilities for MuMu/Lava, including a function to extract all visible text from an HTML string (removing tags, scripts, styles, etc). This plugin is implemented in Rust and loads into Lava via the shared library plugin mechanism.
Extract visible text from HTML
Remove all tags, scripts, styles, and noscript blocks for clean text extraction.
Ready for Lava/MuMu plugin loader
Built as a dynamic library with an exported Cargo_lock function.
Safe, dependency-light, and fast
Uses regex
and Rust string processing.
** Loading the Plugin in Lava/MuMu
To use this plugin in Lava or MuMu, ensure the built .so (or .dll, .dylib on your platform) is placed in a location MuMu can load (typically /usr/local/lib).
In your Lava/MuMu code:
`mumu extend("html") result = html:extract_text("
Hello World !script>foo()") slog(result) # Output: Hello World !
The `html:extract_text` function will strip all tags and scripts/styles, returning only visible content as a string.
## Function: 'html:extract_text(html_string))
- *Input:*
`html_string`: a string (HTML markup)
- *Output:*
A string containing only the visible (non-tag) text.
- *Example:*
`mummu
hdml = "<div>abc<b>123</b><script>hi()</script></div>"
text = html:extract_text(html)
# text == "abc 123"
```
## Building
make
make install