2 个版本
新 0.1.1 | 2024 年 8 月 15 日 |
---|---|
0.1.0 | 2024 年 8 月 15 日 |
#315 在 WebAssembly
230 每月下载量
16KB
271 行
该项目从 XML 字符串创建交互式 HTML 页面。
使用非常简单(希望如此😀)。函数 'create_component' 创建一个具有特定名称和 'source' 属性的自定义组件。如果将 xml 字符串传递给 'source' 属性,则组件将在页面上渲染交互式 xml 树。
v0.1.1
- 添加了不带自定义组件的使用示例
基本示例
use wasm_bindgen::prelude::*;
use xml_viewer::create_component;
#[wasm_bindgen(start)]
fn run() {
create_component("xml-view".to_string());
}
不带自定义组件的示例
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn convert_to_html(xml_source: String) -> String {
xml_viewer::convert_to_html(xml_source)
}
示例
依赖项
~7–9.5MB
~178K SLoC