MCPcopy Create free account
hub / github.com/GCWing/BitFun / wrap_slide_html

Function wrap_slide_html

src/apps/desktop/src/api/miniapp_export_api.rs:32–42  ·  view source on GitHub ↗
(html: &str, width: u32, height: u32)

Source from the content-addressed store, hash-verified

30}
31
32fn wrap_slide_html(html: &str, width: u32, height: u32) -> String {
33 let body = html.trim();
34 if body.to_ascii_lowercase().starts_with("<!doctype")
35 || body.to_ascii_lowercase().starts_with("<html")
36 {
37 return body.to_string();
38 }
39 format!(
40 "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><style>html,body{{margin:0;padding:0;width:{width}px;height:{height}px;overflow:hidden;}}</style></head><body>{body}</body></html>"
41 )
42}
43
44/// Write slide HTML to app cache and return a `file://` URL for the export webview.
45fn file_url_for_export_html<R: tauri::Runtime>(

Callers 1

with_export_webviewFunction · 0.85

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected