Skip to content

Instantly share code, notes, and snippets.

@QuaCKeReD
Last active June 12, 2022 18:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QuaCKeReD/0c0348c6decf60ec5a0a069c0d83a990 to your computer and use it in GitHub Desktop.
Save QuaCKeReD/0c0348c6decf60ec5a0a069c0d83a990 to your computer and use it in GitHub Desktop.
Templater based workflow for creating new notes - Reason: I was fed up of having to select 5 different combinations of metadata, some combinations of which were not valid

<%* tpOptionsList = await tp.file.include('[[noteYamlOptions]]') || '' tpOptions = tpOptionsList.split('\n') || ''

tpOptionChosen = await tp.system.suggester(tpOptions, tpOptions, false, "Select option") || ''

tpOptionChosenArea = tpOptionChosen.toString().split(',')[0] || '' tpOptionChosenCompany = tpOptionChosen.toString().split(',')[1] || '' tpOptionChosenClient = tpOptionChosen.toString().split(',')[2] || '' tpOptionChosenProject = tpOptionChosen.toString().split(',')[3] || ''

tpTypesList = await tp.file.include('[[noteYamlTypes]]') || '' tpTypes = tpTypesList.split('\n') || ''

tpTypeChosen = await tp.system.suggester(tpTypes, tpTypes, false, "Select note type") -%>

title:

area: <% tpOptionChosenArea %> company: <% tpOptionChosenCompany %> client: <% tpOptionChosenClient %> project: <% tpOptionChosenProject %> type: <% tpTypeChosen %>

tags: - <% tp.date.now("[date]/YYYY/MM/DD") %> - <% tp.date.now("[date]/YYYY/[w]/ww") %> created: <% tp.date.now("YYYY-MM-DD HH:mm:SS") %>

<% tp.file.cursor() %>

<%* fileTitle = tp.date.now("YYYY-MM-DD HHmmSS"); fileFolder = "/02 Diary/" + tp.date.now("YYYY/MM"); existsFolder = await app.vault.adapter.exists(fileFolder, true); if ( ! existsFolder ) { await app.vault.createFolder(fileFolder); } fileName = fileFolder + "/" + fileTitle; await tp.file.move(fileName); -%>

personal personal,,,new project work work,client work,client,customer,project

activity meeting review

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