Daily Inspirational Quote or Bible Verse Mindmap #144
Replies: 5 comments 3 replies
-
I made a few changes to the template. This is the version I currently use in my DNP: <%*
const colors = ["Chocolate", "Coral", "CornflowerBlue", "CadetBlue", "DarkKhaki", "DarkOrange", "DarkCyan", "DarkSeaGreen", "DarkSalmon", "DeepSkyBlue", "Gainsboro", "GoldenRod", "Gold", "IndianRed", "Lavender", "LightGreen", "LightPink", "Linen", "MistyRose", "OliveDrab", "PaleTurquoise", "PaleVioletRed", "Peru", "Plum", "SandyBrown", "Silver", "Tan", "Tomato"];
const color = colors[Math.floor(Math.random()*colors.length)];
let folder = app.vault.config.attachmentFolderPath;
if(folder && folder.startsWith("./")) { //subfolder of current file
const cleanPath = folder.substring(2); //without the "./" at the beginning
folder = tp.file.folder(true) === "/" ? cleanPath + "/" : tp.file.folder(true) + "/" + cleanPath + "/";
}
const title = tp.file.title + " - Daily Quote";
//const response = await fetch("https://quotes.rest/qod?language=en");
const response = await fetch("http://api.quotable.io/random?tags="); //Add tags=inspirational,proverb to get quotes with specific tags. To list all available tags: http://api.quotable.io/tags?
const data = await response.json();
if (response.ok) {
//const data = (await response.json()).contents.quotes[0];
const ea = ExcalidrawAutomate;
ea.reset();
ea.style.backgroundColor = "transparent"
const textId = ea.generateElementId();
const boxId = ea.addText(0,0,`${data.content}\n[[${data.author}]]`,{wrapAt:40,textAlign:"center",box:"box",boxPadding:10},textId);
const box = ea.getElement(boxId);
box.strokeColor = "transparent";
ea.style.backgroundColor = color;
ea.setStrokeSharpness(0);
const blobId = ea.addBlob(-90,-90,box.width+180, box.height+180);
//change z-order
const text = ea.getElement(textId);
delete ea.elementsDict[boxId];
delete ea.elementsDict[textId];
ea.elementsDict[box.id] = box;
ea.elementsDict[text.id] = text;
ea.addToGroup([blobId,boxId,textId]);
const fpath = await ea.create({
filename:title,
foldername:folder,
templatePath: app.plugins.getPlugin("obsidian-excalidraw-plugin").settings.templateFilePath,
onNewPane: true,
frontmatterKeys: {
"excalidraw-plugin": "parsed",
"excalidraw-link-prefix": "",
"excalidraw-link-brackets": true,
}
});
tR += `![[${fpath}]]\n`;
f = app.vault.getAbstractFileByPath(fpath);
console.log(await app.vault.read(f));
} else {
console.log("error",data);
}
%> |
Beta Was this translation helpful? Give feedback.
-
Templater showcase: https://github.com/SilentVoid13/Templater/discussions/categories/templates-showcase I will build an Excalidraw Automate function that will take a list of files and do the OCR on them. You can then schedule your cornJob to run whenever you like. |
Beta Was this translation helpful? Give feedback.
-
I've updated my script. It now consists of two files. File 1) is my DNP Templater script. File 2) is the Excalidraw template file used by the script. This zip file contains both: DNP Template.zip Change |
Beta Was this translation helpful? Give feedback.
-
Here's my current |
Beta Was this translation helpful? Give feedback.
-
I've updated the template. It will now check 4 different sources in random order. Here's the new template: |
Beta Was this translation helpful? Give feedback.
-
Mindmapping engages your creativity by utilizing the full power of your visual brain. These two Templater scripts will create a mindmap of a random daily quote or a Bible Verse.
Please update your Obsidian Excalidraw plugin to 1.3.9 or higher before running this script.
You can insert these scripts into your daily notes template. Watch the YouTube video here.
The scripts work best if you also have Ozan's Image-in-Editor plugin installed.
The Bible Verse script will attempt to link the verse to your Bible in Obsidian, assuming that you are using Joschua's Bible Study in Obsidian Kit.
You can find the ExcalidrawAutomate documentation here.
Daily Quote
Daily Bible Verse
Beta Was this translation helpful? Give feedback.
All reactions