Skip to content

Instantly share code, notes, and snippets.

@QuaCKeReD
Last active July 7, 2025 23:53
Show Gist options
  • Select an option

  • Save QuaCKeReD/0c0348c6decf60ec5a0a069c0d83a990 to your computer and use it in GitHub Desktop.

Select an option

Save QuaCKeReD/0c0348c6decf60ec5a0a069c0d83a990 to your computer and use it in GitHub Desktop.

Revisions

  1. QuaCKeReD revised this gist Apr 29, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion noteYamlOptions.md
    Original file line number Diff line number Diff line change
    @@ -2,5 +2,5 @@
    personal
    personal,,,new project
    work
    work.client
    work,client
    work,client,customer,project
  2. QuaCKeReD revised this gist Apr 28, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions new note.md
    Original file line number Diff line number Diff line change
    @@ -18,10 +18,10 @@ tpTypeChosen = await tp.system.suggester(tpTypes, tpTypes, false, "Select note t
    ---
    title:

    area: <% tpOptionArea %>
    company: <% tpOptionCompany %>
    client: <% tpOptionClient %>
    project: <% tpOptionProject %>
    area: <% tpOptionChosenArea %>
    company: <% tpOptionChosenCompany %>
    client: <% tpOptionChosenClient %>
    project: <% tpOptionChosenProject %>
    type: <% tpTypeChosen %>

    tags:
  3. QuaCKeReD revised this gist Apr 28, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion new note.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ area: <% tpOptionArea %>
    company: <% tpOptionCompany %>
    client: <% tpOptionClient %>
    project: <% tpOptionProject %>
    type: <% tpOptionTypeChosen %>
    type: <% tpTypeChosen %>

    tags:
    - <% tp.date.now("[date]/YYYY/MM/DD") %>
  4. QuaCKeReD revised this gist Apr 28, 2022. 1 changed file with 14 additions and 11 deletions.
    25 changes: 14 additions & 11 deletions new note.md
    Original file line number Diff line number Diff line change
    @@ -4,22 +4,25 @@ tpOptions = tpOptionsList.split('\n') || ''

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

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

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

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

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

    area: <% tpOptionsArea %>
    company: <% tpOptionsCompany %>
    client: <% tpOptionsClient %>
    project: <% tpOptionsProject %>
    type: <% tp.system.suggester(tpOptionType, tpOptionType, false, "Select note type") %>
    area: <% tpOptionArea %>
    company: <% tpOptionCompany %>
    client: <% tpOptionClient %>
    project: <% tpOptionProject %>
    type: <% tpOptionTypeChosen %>

    tags:
    - <% tp.date.now("[date]/YYYY/MM/DD") %>
  5. QuaCKeReD revised this gist Apr 28, 2022. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions new note.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    <%*
    tpOptionsList = await tp.file.include('[[noteYamlOptions]]') || ''
    tpOptions = tpOptionsList.split('\n')
    tpOptions = tpOptionsList.split('\n') || ''

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

    tpOptionsArea = tp_OptionChosen.toString().split(',')[0] || ''
    tpOptionsCompany = tp_OptionChosen.toString().split(',')[1] || ''
    tpOptionsClient = tp_OptionChosen.toString().split(',')[2] || ''
    tpOptionsProject = tp_OptionChosen.toString().split(',')[3] || ''
    tpOptionsCompany = tpOptionChosen.toString().split(',')[1] || ''
    tpOptionsClient = tpOptionChosen.toString().split(',')[2] || ''
    tpOptionsProject = tpOptionChosen.toString().split(',')[3] || ''

    tpOptionTypeList = await tp.file.include('[[noteYamlTypes]]') || ''
    tpOptionType = tpOptionTypeList.split('\n')
    tpOptionType = tpOptionTypeList.split('\n') || ''
    -%>
    ---
    title:
  6. QuaCKeReD renamed this gist Apr 28, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. QuaCKeReD revised this gist Apr 28, 2022. No changes.
  8. QuaCKeReD revised this gist Apr 28, 2022. No changes.
  9. QuaCKeReD revised this gist Apr 28, 2022. 2 changed files with 4 additions and 1 deletion.
    2 changes: 2 additions & 0 deletions noteYamlOptions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@

    personal
    personal,,,new project
    work
    work.client
    work,client,customer,project
    3 changes: 2 additions & 1 deletion noteYamlTypes.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@

    activity
    meeting
    meeting
    review
  10. QuaCKeReD renamed this gist Apr 28, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  11. QuaCKeReD revised this gist Apr 28, 2022. No changes.
  12. QuaCKeReD revised this gist Apr 28, 2022. 1 changed file with 0 additions and 11 deletions.
    11 changes: 0 additions & 11 deletions Obsidian New Note Workflow
    Original file line number Diff line number Diff line change
    @@ -1,11 +0,0 @@
    Templater based workflow for creating new notes

    new note.md is the template file

    This reads contents from noteYamlOptions & noteYamlTypes and presents them as options

    It additionally then splits the chosen entry from noteYamlOptions and uses individual values for yaml frontmatter


    Reason:
    I was fed up of having to select 5 different combinations of metadata, some combinations of which were not valid
  13. QuaCKeReD revised this gist Apr 28, 2022. 4 changed files with 58 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion Obsidian New Note Workflow
    Original file line number Diff line number Diff line change
    @@ -1 +1,11 @@
    Templater based workflow for creating new notes
    Templater based workflow for creating new notes

    new note.md is the template file

    This reads contents from noteYamlOptions & noteYamlTypes and presents them as options

    It additionally then splits the chosen entry from noteYamlOptions and uses individual values for yaml frontmatter


    Reason:
    I was fed up of having to select 5 different combinations of metadata, some combinations of which were not valid
    40 changes: 40 additions & 0 deletions new note.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    <%*
    tpOptionsList = await tp.file.include('[[noteYamlOptions]]') || ''
    tpOptions = tpOptionsList.split('\n')

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

    tpOptionsArea = tp_OptionChosen.toString().split(',')[0] || ''
    tpOptionsCompany = tp_OptionChosen.toString().split(',')[1] || ''
    tpOptionsClient = tp_OptionChosen.toString().split(',')[2] || ''
    tpOptionsProject = tp_OptionChosen.toString().split(',')[3] || ''

    tpOptionTypeList = await tp.file.include('[[noteYamlTypes]]') || ''
    tpOptionType = tpOptionTypeList.split('\n')
    -%>
    ---
    title:

    area: <% tpOptionsArea %>
    company: <% tpOptionsCompany %>
    client: <% tpOptionsClient %>
    project: <% tpOptionsProject %>
    type: <% tp.system.suggester(tpOptionType, tpOptionType, false, "Select note type") %>

    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);
    -%>
    4 changes: 4 additions & 0 deletions noteYamlOptions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@

    personal
    work
    work,client,customer,project
    3 changes: 3 additions & 0 deletions noteYamlTypes.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@

    activity
    meeting
  14. QuaCKeReD created this gist Apr 28, 2022.
    1 change: 1 addition & 0 deletions Obsidian New Note Workflow
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Templater based workflow for creating new notes