Closed pcause closed 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` } }) %>
[${e.callType}](${e.callUrl})
: ''; tR+=
if (e.description && e.description != "" && e.description != "\n") { const inlineDescription = e.description.replace(/(?:\r\n|\r|\n)/g," ").replace(/\s{2,}/g," "); tR+=
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!
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} \nif (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` } }) %>