Skip to content

Instantly share code, notes, and snippets.

@nathonius
Last active November 24, 2021 23:47
Show Gist options
  • Save nathonius/3f70e6fa9caa109e2af4db0706fd96d3 to your computer and use it in GitHub Desktop.
Save nathonius/3f70e6fa9caa109e2af4db0706fd96d3 to your computer and use it in GitHub Desktop.
TTRPG Templates
metatable title campaign session session_date tags
true
Untitled
CampaignName
1
<% tp.date.now("MM.DD.YYYY") %>
RPG/CampaignName, RPG/SessionNotes/DM

= this.title

⬅ [[|Last Session]] / [[|Next Session]] ➡ date: = this.session_date PC: NPC Active: NPC Discussed: Location Active: Location Discussed: Monsters:

Post session notes

To do before next session

Soon

<%* const templateFilePath = "00 Meta/02 Templates/RPG/Session Notes - DM.md"; const templateFile = this.app.vault.getAbstractFileByPath(templateFilePath); const {update, getPropertyValue} = this.app.plugins.plugins["metaedit"].api; // Get current session number, next session number const oldNumber = await getPropertyValue('session', templateFile); const newNumber = ${oldNumber + 1}.padStart(3, '0'); const oldNumberPadded = ${oldNumber}.padStart(3, '0');

// Update title of new file let title = tp.file.title; title = S${oldNumberPadded} ${tp.date.now("MM.DD.YYYY")}; await tp.file.rename(title);

// Update session number in template await update('session', ${newNumber}, templateFile); %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment