mumu-html

Crates.iomumu-html
lib.rsmumu-html
version0.1.1
created_at2025-06-24 07:23:49.824902+00
updated_at2025-06-24 07:56:33.336851+00
descriptionHTML manipulation and tools plugin for the Lava language
homepagehttps://lava.nu11.uk
repositoryhttps://gitlab.com/tofo/mumu-html
max_upload_size
id1723944
size19,263
(rusty-shrimp)

documentation

README

mumu-html

HTML manipulation and extraction plugin for the Lava language (MuMu runtime).

crates.io !license](./LICENSE) GitLab project

Overview

** 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.

Features

  • 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.

Usage

** 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
Commit count: 0

cargo fmt