Files
ElyOffice/apps/ely-table/src/template.rs
T
ZacharyZhang-NY b7fca0146d Ely Office: six offline-first desktop apps in Rust and GPUI
ElyDoc, ElyTable, ElyShow (LibreOfficeKit), ElyPDF (MuPDF), ElyTree (Git),
ElyMark (Milkdown and CodeMirror in CEF). ElyMail and ElyAgent follow.
2026-10-08 21:20:08 -04:00

16 lines
793 B
Rust

//! The blank workbook a new window starts from (TABLE-01).
use gpui::App;
/// A one-sheet flat ODF workbook with a local name.
pub fn blank(cx: &App) -> String {
let name = ely_ui::i18n::text(cx, "table.sheet.default", &[("n", "1")]);
let name = name
.replace('&', "&")
.replace('<', "&lt;")
.replace('"', "&quot;");
format!(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<office:document xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\" office:version=\"1.3\" office:mimetype=\"application/vnd.oasis.opendocument.spreadsheet\"><office:body><office:spreadsheet><table:table table:name=\"{name}\"/></office:spreadsheet></office:body></office:document>\n"
)
}