30 lines
1.1 KiB
Rust
30 lines
1.1 KiB
Rust
use wasm_bindgen::prelude::*;
|
|
|
|
#[wasm_bindgen]
|
|
pub fn render_markdown(md: &str) -> String {
|
|
let parser = pulldown_cmark::Parser::new(md);
|
|
let mut html = String::new();
|
|
pulldown_cmark::html::push_html(&mut html, parser);
|
|
// wrap tables
|
|
html = html.replace("<table>", "<table class=\"table\">");
|
|
html
|
|
}
|
|
|
|
#[wasm_bindgen]
|
|
pub fn module_list() -> String {
|
|
serde_json::to_string(&[
|
|
("01_auth", "安全認證", "Authentication"),
|
|
("02_health", "健康檢查", "Health"),
|
|
("03_register", "檔案註冊", "File Registration"),
|
|
("04_lookup", "檔案屬性查詢", "File Lookup"),
|
|
("05_process", "處理流程", "Processing"),
|
|
("06_search", "搜尋功能", "Search"),
|
|
("07_identity", "身份識別", "Identity"),
|
|
("08_identity_agent", "智能身份綁定", "Smart Identity Binding"),
|
|
("08_media", "串流與截圖", "Streaming & Thumbnails"),
|
|
("09_tmdb", "TMDb 整合", "TMDb Integration"),
|
|
("10_pipeline", "生產線", "Pipeline"),
|
|
("12_agent", "智慧代理", "AI Agents"),
|
|
]).unwrap_or_default()
|
|
}
|