- 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
<%* /*
*/
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?
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 scriptYouTube-Thumbnail.md
andYouTube-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 <% "---" %>
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": "<%tp.file.folder()%>"
in the JSON block and make sure it is not "text": "<%tp.file.folder()\n%>"
, or anything similar.
/*
const FILENAME_FILTER = /^icon -/i;
const KEYWORD_GRABBER = /(?:icon -)?([^-]*)-?/i;
const COLS = 30;
const LOCK_ICONS = true;
const HEIGHT = 180;
const WIDTH = 180;
const TEXTHEIGHT = 40;
const PADDING = 50;
<%* /* https://gist.github.com/zsviczian/c7223c5b4af30d5c88a0cae05300305c/edit
*/
const installStyleHook = () => {
if(!window.ExcalidrawAutomate) return false;
ExcalidrawAutomate.onCanvasColorChangeHook = (ea, view, color) => {
const doc = view.ownerDocument;
https://youtu.be/OX5_UYjXEvc | |
 |
@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; |
<%*
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"});
<%* /*
/**
* Obsidian Templater script to build a book from markdown files.
*
* This script automates the process of generating a publish-ready book from a set of Obsidian markdown files.
* It is designed to work on both Windows and Mac, and can be run from within Obsidian using the Templater plugin.
*
* The script performs the following steps:
* 1. Expands all Obsidian embeds and links, recursively flattening the book structure into two markdown files: