Skip to content

Commit e2c8a49

Browse files
backnotpropclaude
andcommitted
feat: add YAML frontmatter properties to Octarine notes
Prepend Octarine-compatible YAML frontmatter with tags, Status, Author, and Last Edited properties. Uses the same extractTags() as Obsidian for auto-generated tags (project name, title words, code fence languages). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1f5178b commit e2c8a49

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

packages/server/integrations.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,16 @@ export async function saveToBear(config: BearConfig): Promise<IntegrationResult>
329329

330330
// --- Octarine Integration ---
331331

332+
/**
333+
* Generate YAML frontmatter for an Octarine note.
334+
* Uses Octarine's property format (list-style tags, Status, Author, Last Edited).
335+
*/
336+
export function generateOctarineFrontmatter(tags: string[]): string {
337+
const now = new Date().toISOString().slice(0, 16); // YYYY-MM-DDTHH:MM
338+
const tagLines = tags.map(t => ` - ${t.toLowerCase()}`).join('\n');
339+
return `---\ntags:\n${tagLines}\nStatus: Draft\nAuthor: plannotator\nLast Edited: ${now}\n---`;
340+
}
341+
332342
/**
333343
* Save plan to Octarine using octarine:// URI scheme
334344
*/
@@ -341,7 +351,11 @@ export async function saveToOctarine(config: OctarineConfig): Promise<Integratio
341351
const basename = filename.replace(/\.md$/, '');
342352
const path = folder ? `${folder}/${basename}` : basename;
343353

344-
const url = `octarine://create?path=${encodeURIComponent(path)}&content=${encodeURIComponent(plan)}&workspace=${encodeURIComponent(workspace)}&openAfter=false`;
354+
const tags = await extractTags(plan);
355+
const frontmatter = generateOctarineFrontmatter(tags);
356+
const content = `${frontmatter}\n\n${plan}`;
357+
358+
const url = `octarine://create?path=${encodeURIComponent(path)}&content=${encodeURIComponent(content)}&workspace=${encodeURIComponent(workspace)}&openAfter=false`;
345359

346360
await $`open ${url}`.quiet();
347361

0 commit comments

Comments
 (0)