Skip to content

Instantly share code, notes, and snippets.

zsviczian /
Last active January 27, 2024 06:00
Excalidraw Scripting - Daily Quote Illustrations in Obsidian with Templater, Excalidraw and OpenAI

<%* const ea = ExcalidrawAutomate; const imageSize = 1024x1024; const instruction = "Return a single message with the generated image prompt in a codeblock"; const systemPrompt = "Your task involves transforming a user-provided quote into a detailed and imaginative illustration. Craft a visual representation that captures the essence of the quote and resonates well with a broad audience. Additionally, provide preferences for styling, such as the chosen medium and artistic direction, to guide the image creation process. Ensure the resulting image remains text-free. Your task output should comprise a descriptive and detailed narrative aimed at facilitating the creation of a captivating illustration from the quote.";

//--------------------------------------- //Get Quote from stoic quotes //--------------------------------------- const quoteString = await request({url: ""});

zsviczian / publish.css
Last active April 29, 2024 00:18
Excalidraw Obsidian Publish Support
@font-face {font-family: "Virgil";src: url("");}
@font-face {font-family: "Cascadia";src: url("");}
@font-face {font-family: "Assistant";src: url("");}
div.markdown-embed-title {
display: none;
div.markdown-embed {
border: none;
zsviczian / Readme
Created November 9, 2023 21:40
ExcalidrawAutomate onFileOpenHook
![Thumbnail - 20231109 Excalidraw on-load script (Custom)](
zsviczian / Excalidraw Dynamic
Last active June 18, 2023 00:40
Excalidraw Dynamic Styling
zsviczian / Icon Library
Last active May 26, 2024 23:45
Excalidraw Icon Library


KEYWORD_GRABBER=/(?:icon -)?([^-]*)-?/i;
const api = ea.getExcalidrawAPI();
zsviczian /
Last active June 9, 2023 06:25
My YouTube Workflow in Obsidian with Templater, Kanban, and Excalidraw

Please watch this video to understand how to use this script: The Gist contains 3 files

  • is the main Templater script
  • and are two Excalidraw template files.

To download the files and add to your Obsidian Vault select Download ZIP at the top of the page, or switch to Raw view for each file and copy/paste the contents into Obsidian.

⚠⚠⚠ ATTENTION ⚠⚠⚠ Since releasing the video I realized that adding Templater script tags to text elements will only work if there is no linebreak in the text. Thus you are probably better off with the solution now included in this Gist, where I apply the same &lt;% "---" %&gt; trick to as I do in as explained in the video. If you need to debug script tags, be sure to look for "text": "&lt;%tp.file.folder()%&gt;" in the JSON block and make sure it is not "text": "&lt;%tp.file.folder()\n%&gt;", or anything similar.

zsviczian /
Last active March 16, 2024 18:57
Daily note taking scripts

<%* /*

const view = app.workspace.activeLeaf.view;
const editor = view.editor;
const curLineNum = editor.getCursor().line;
const curLineText = editor.getLine(curLineNum);
const title = tp.file.title;
const today = title.match(/\d{4}\-\d{2}\-\d{2} .+/) //are we on the DNP?
zsviczian /
Created May 7, 2021 18:56
This is an Obsidian Templater script that genrates a mindmap drawing from a tabulated outline, similar to the sample outline attached.
  • Test 1
    • Test 1.1
  • Test 2
    • Test 2.1
    • Test 2.2
      • Test 2.2.1
      • Test 2.2.2
      • Test 2.2.3
        • Test
  • Test 3