<%*
let title = tp.file.title;
if (title.startsWith("Untitled")) {
title = await tp.system.prompt("Gib den Titel der Notiz ein:");
await tp.file.rename(title);
}
// Use tp.system.suggester for type selection (v, w, x, y, z)
let type = await tp.system.suggester(["Zettel", "Lecture", "Outline", "Research", "Thought", "Creative", "Technical", "Hub"],["Zettel", "Lecture", "Outline", "Research", "Thought", "Creative", "Technical", "Hub"]);
// Map types to tags
let tags = [];
let reference_material = "";
let reference_type = "";
// Define the tags and reference material logic
if (type === "Outline Note") {
tags = ["Structure", "Planning"];
await tp.file.move("Outlines/"+ title);
} else if (type === "Research Note") {
tags = ["Sources", "KeyFindings", "Data"];
} else if (type === "Analytical Note"){
tags = ["Evaluations", "Insights", "ProsCons"];
// Ask for the reference material name if type is x or y
reference_material = await tp.system.prompt("Enter the name/description of the reference material:");
// Use tp.system.suggester for reference type selection only if x or y is selected
reference_type = await tp.system.suggester(["Personal", "Theory", "Expert", "Data"],["Personal", "Theory", "Expert", "Data"]);
} else if (type === "Creative Note"){
tags = ["Brainstorming", "Inspiration", "Draft"];
reference_material = await tp.system.prompt("Enter the name/description of the reference material:");
// Use tp.system.suggester for reference type selection only if x or y is selected
reference_type = await tp.system.suggester(["Inspiration", "Music", "VisualMedia"],["Inspiration", "Music", "VisualMedia"]);
} else if (type === "Technical Note") {
tags = ["Code", "Specification", "Troubleshooting"];
} else {
tags = ["default_tag"];
}
// Default values for missing frontmatter fields
let categories = "General"; // Example, change as needed
let cssclass = "note"; // Example, change as needed
let hub = "false"; // Example, change as needed
-%>
---
title: <% title %>
categories: <% categories %>
cssclass: <% cssclass %>
created: <% tp.file.creation_date("YYYY-MM-DD HH:mm:ss") %>
type: <% type %>
tags: <% tags.join(", ") %>
<%* if (reference_material !== "") { -%> reference_material: <% reference_material %>
reference_type: <% reference_type %>
<%* } -%>
hub: <% hub %>
---
<!-- Layout Start -->
<!-- First Line: Title and Time Created on the same line -->
<div style="display: flex; justify-content: space-between; align-items: center;">
<b style="color: #7BCCB5; margin: 0; font-size: 1em;"><% type %>-note</b>
<b><span style="font-size: 1em;">Created: <% tp.file.creation_date("YYYY-MM-DD HH:mm:ss") %></span></b>
</div>
<!-- Second Line: Display Reference Material if exists --> <%* if (reference_material !== "") { %> <p><% reference_material %></p> <%* } %>
<!-- Third Line: Placeholder for syncing tags -->
<p><span style="font-size: small; color: #728FCE; tags-placeholder">21thisisfortags12</span></p>
<!-- Layout End -->