mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
docs: resolve typos and add Chinese documentation - Fixed multiple spelling errors (e.g. "nmuber" → "number") - Removed a blank file (foo) - Added Chinese version of documentation with cross-linking between readme.md of languages [Note] Added a translator donation link in docs/zh-cn/docs/readme.md - please confirm if appropriate
1.1 KiB
1.1 KiB
◀ Excalidraw 自动化使用指南
在当前编辑的文档中插入新绘图
这个 Templater 模板会提示你输入绘图的标题。它将使用提供的标题创建一个新的绘图,并将其保存在你正在编辑的文档所在的文件夹中。然后,它会在光标位置嵌入新绘图,并通过拆分当前页面的方式在新的工作区中打开这个绘图。
使用 CTRL+Shift+V 将代码粘贴到 Obsidian 中!
<%*
const defaultTitle = tp.date.now("HHmm")+' '+tp.file.title;
const title = await tp.system.prompt("Title of the drawing?", defaultTitle);
const folder = tp.file.folder(true);
const transcludePath = (folder== '/' ? '' : folder + '/') + title + '.excalidraw';
tR = '![['+transcludePath+']]';
const ea = ExcalidrawAutomate;
ea.reset();
ea.setTheme(1); //set Theme to dark
await ea.create({
filename : title,
foldername : folder,
//templatePath: 'Excalidraw/Template.excalidraw', //uncomment if you want to use a template
onNewPane : true
});
%>