cloud-atlas-ai / obsidian-ics

Generate Daily Planner from ical feeds
MIT License
142 stars 27 forks source link

mod to your templater example #84

Closed pcause closed 1 year ago

pcause commented 1 year ago

thought this might be of use. a mod to the templater example. puts the description in a callout. also, in MS365 an empty description has content. "\n" or is "", so added a check otherwise after each tasks I get a line with just an indented bullet

<% var events = await app.plugins.getPlugin('ics').getEvents(moment(tp.file.title,'YYYY-MM-DD')); events.sort((a,b) => a.utime - b.utime).forEach((e) => { const calendar = e.icsName.replace(" ","-"); const callUrl = e.callUrl? [${e.callType}](${e.callUrl}) : ''; const location = e.location? ` 📍 (${e.location})*: ''; tR+=- [ ] ${e.time} ${e.endTime} ${e.summary} ${location}${callUrl} \n if (e.description && e.description != "" && e.description != "\n") { const inlineDescription = e.description.replace(/(?:\r\n|\r|\n)/g," ").replace(/\s{2,}/g," "); tR+=> [!INFO]-\n> - ${inlineDescription}\n` } }) %>

muness commented 1 year ago

Hi @pcause , thanks for the example! There's already a discussion with a couple of examples, so maybe add it there or to a new discussion? Cheers!