Skip to content

Instantly share code, notes, and snippets.

@zsviczian
zsviczian / DNP.md
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: "https://stoic-quotes.com/api/quote"});

@zsviczian
zsviczian / publish.css
Last active April 29, 2024 00:18
Excalidraw Obsidian Publish Support
@font-face {font-family: "Virgil";src: url("https://excalidraw.com/Virgil.woff2");}
@font-face {font-family: "Cascadia";src: url("https://excalidraw.com/Cascadia.woff2");}
@font-face {font-family: "Assistant";src: url("https://excalidraw.com/Assistant-Regular.woff2");}
div.markdown-embed-title {
display: none;
}
div.markdown-embed {
border: none;
@zsviczian
zsviczian / Readme
Created November 9, 2023 21:40
ExcalidrawAutomate onFileOpenHook
https://youtu.be/OX5_UYjXEvc
![Thumbnail - 20231109 Excalidraw on-load script (Custom)](https://github.com/zsviczian/obsidian-excalidraw-plugin/assets/14358394/8d741faf-9ce6-4d83-bb7a-fdc887a30918)
@zsviczian
zsviczian / Excalidraw Dynamic Styling.md
Last active June 18, 2023 00:40
Excalidraw Dynamic Styling
@zsviczian
zsviczian / Icon Library Script.md
Last active May 26, 2024 23:45
Excalidraw Icon Library

/*

FILENAME_FILTER=/^icon -/i;
KEYWORD_GRABBER=/(?:icon -)?([^-]*)-?/i;
COLS=22;
HEIGHT=180;
WIDTH=180;
TEXTHEIGHT=40;
PADDING=50;
const api = ea.getExcalidrawAPI();
@zsviczian
zsviczian / Readme.md
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: https://youtu.be/qDSHBnl83r8 The Gist contains 3 files

  • YouTube-create.md is the main Templater script
  • YouTube-Thumbnail.md and YouTube-Storyboard.md 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 YouTube-Thumbnail.md as I do in YouTube-Storyboard.md 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
zsviczian / meeting-note.md
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
zsviczian / MindmapInput.md
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 2.2.3.1
  • Test 3