diff --git a/AutomateHowTo.md b/AutomateHowTo.md index 7d7aa7b..3ab66b2 100644 --- a/AutomateHowTo.md +++ b/AutomateHowTo.md @@ -6,7 +6,7 @@ With a little work, using Excalidraw Automate you can generate simple mindmaps, You can access Excalidraw Automate via the ExcalidrawAutomate object. I recommend staring your Automate scripts with the following code. -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript const ea = ExcalidrawAutomate; ea.reset(); @@ -27,7 +27,7 @@ You can change styling between adding different elements. My logic for separatin #### Create a new drawing with custom name, in a custom folder, using a template This simple script gives you significant additional flexibility over Excalidraw Plugin settings to name your drawings, place them into folders, and to apply templates. -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript <%* const ea = ExcalidrawAutomate; @@ -42,7 +42,7 @@ Use CTRL+Shift+V to paste it into Obsidian! ``` #### Create a simple drawing -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript <%* const ea = ExcalidrawAutomate; @@ -63,7 +63,7 @@ The script will generate the following drawing: ## Attributes and functions at a glance Here's the interface implemented by ExcalidrawAutomate: -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript ExcalidrawAutomate: { style: { @@ -324,7 +324,7 @@ Returns a blob containing a PNG image of the generated drawing. ### Create new drawing and insert into currently edited document This template will prompt you for the title of the drawing. It will create a new drawing with the provided title, and in the folder of the document you were editing. It will then transclude the new drawing at the cursor location and open the new drawing in a new workspace leaf by splitting the current leaf. -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript <%* defaultTitle = tp.file.title; @@ -332,17 +332,17 @@ Use CTRL+Shift+V to paste it into Obsidian! tR = String.fromCharCode(96,96,96)+'excalidraw\n[['+title+'.excalidraw]]\n'+String.fromCharCode(96,96,96) const ea = ExcalidrawAutomate; ea.reset(); + ea.setTheme(1); //set Theme to dark await ea.create({ filename : title, foldername : tp.file.folder(true), - template : 'Excalidraw/Template.excalidraw', onNewPane : true }); %> ``` ### Connect objects -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript <%* const ea = ExcalidrawAutomate; @@ -359,7 +359,7 @@ Use CTRL+Shift+V to paste it into Obsidian! ### Using a template This example is similar to the first one, but rotated 90°, and using a template, plus specifying a filename and folder to save the drawing, and opening the new drawing in a new pane. -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript <%* const ea = ExcalidrawAutomate; @@ -399,7 +399,7 @@ Example input: The script: -Use CTRL+Shift+V to paste it into Obsidian! +*Use CTRL+Shift+V to paste code into Obsidian!* ```javascript <%* const IDX = Object.freeze({"depth":0, "text":1, "parent":2, "size":3, "children": 4, "objectId":5});