Skip to content

This obsidian plugin creates a structure for your daily notes

License

Notifications You must be signed in to change notification settings

db-developer/daily-note-structure

Repository files navigation

Daily Note Structure

Can be used to create a folder structure which finally holds the actual daily note. If your 'daily' notes simply are a number of markdown files within a default folder, you will NOT need this plugin.

The purpose of this plugin is, to automate the daily creation of multiple folders and files.

Best Result Plugins

You may want to install the following obsidian plugins:

Date/Time format patterns

For compatibility reasons, 'daily note structure' uses 'moment.js' so all of 'moment.js' formats are available.

Additionally the following formats can be used:

Description Token Output
Month of the weeks first day MOW 1 2 ... 11 12
MoW 1st 2nd ... 11th 12th
MMOW 01 02 ... 11 12
MMMOW Jan Feb ... Nov Dec
MMMMOW January February ... November December

The format above may be useful for the first days of a new month, if you want to keep all 'dailies' of a week in the same folder.

Format patterns to be used by 'moment.js' must follow the format '{{ ... }}' and are replaced first.

Format errors

Evaluation errors for bad format patterns can be found in obsidians developer console (++i) Note: Not every bad pattern will fail with an error. Some will silently return 'unexpected results'.

Folder structure

export interface FolderStructure {
  type: "folder" | "file";
  namepattern: string;
  template?: string;
  description?: string;
  children?: FolderStructure[];
}

Using the FolderStructure interface, you can setup a 'structure' on the plugins settings page. The structure itself is an Array of FolderStructure objects.

[{
  "type": "folder",
  "namepattern": "{{YYYY}}",
  "template": "Plugins/Templater/Templates/yearly_folder_note_template.md",
  "description": "yearly folder base",
  "children": [{
    "type": "folder",
    "namepattern": "{{MMOW}} - {{MMM}} {{YYYY}}",
    "template": null,
    "description": "folder matching the month for the first day in the week",
    "children": [{
      "type": "folder",
      "namepattern": "KW {{WW}} ({{MMM}} {{YYYY}})",
      "template": null,
      "description": "folder matching the years week",
      "children": [{
        "type": "file",
        "namepatern": "{{YYYY}}-{{MM}}-{{DD}}",
        "template": "Plugins/Templater/Templates/daily_template.md"
      }]
    }]
  }]
}]

Property 'type': {string} - required

Must be one of "folder" or "file"

Property 'namepattern': {string} - required

A string, which can hold any combination of characters ad patterns. Patterns must follow '{{}}' with pattern being exactly one of 'moment.js' formats

Do not combine patterns inline. Don't use {{YYYY-MM-DD}}. The supported way of combining patterns would be '{{YYYY}}-{{MM}}-{{DD}}' instead.

Property 'template': {string} - optional

An optional string, which can hold a path to a markdown file, that can be used as template. If a template is specified for 'type: "file"', the generated files content will be that of 'template'. If a template is specified for 'type: "folder"', a markdown file will be generated inside the folder, with the folders name, and its content will be that of 'template'. For best results, additionally install a 'folder note' plugin.

Property 'description': {string} - optional

An optional string, which can be used to describe the files or folders purpose. This property currently is not used for anything else.

Property 'children': {Array} - optional

An Array of further FolderStructure nodes. This property is used by nodes of 'type: "folder"' only. If specified on "files", the property is ignored.

About

This obsidian plugin creates a structure for your daily notes

Resources

License

Stars

Watchers

Forks

Packages

No packages published