|
| 1 | +# Temporary Docs Handoff: TemplateRunner Calendar Targets |
| 2 | + |
| 3 | +This temporary note summarizes the `np.Templating` 2.4.0 updates for documentation work. It can be removed after the public docs are updated. |
| 4 | + |
| 5 | +## Summary |
| 6 | + |
| 7 | +`TemplateRunner` frontmatter field `getNoteTitled` can now target calendar notes more directly. |
| 8 | + |
| 9 | +Previously, `getNoteTitled` handled a few special targets such as `<today>`, `<thisweek>`, `<nextweek>`, `<current>`, `<choose>`, and `<select>`. Daily dates rendered from template tags, such as `2026-05-03`, could fall through to regular project-note title lookup. |
| 10 | + |
| 11 | +Now, after template tags in `getNoteTitled` are rendered, valid calendar note titles route to calendar notes instead of regular note title lookup. |
| 12 | + |
| 13 | +## Supported Calendar Title Formats |
| 14 | + |
| 15 | +These rendered values are treated as calendar note targets: |
| 16 | + |
| 17 | +- Daily: `YYYY-MM-DD`, for example `2026-05-03` |
| 18 | +- Monthly: `YYYY-MM`, for example `2026-06` |
| 19 | +- Quarterly: `YYYY-Qn`, for example `2026-Q3` |
| 20 | +- Yearly: `YYYY`, for example `2026` |
| 21 | + |
| 22 | +Invalid date-shaped values are not treated as calendar notes. For example, `2024-99-99`, `2024-13`, and `2024-Q5` are rejected by strict validation and continue through the normal handling path. |
| 23 | + |
| 24 | +## New Relative Tokens |
| 25 | + |
| 26 | +`getNoteTitled` now supports these additional relative calendar tokens: |
| 27 | + |
| 28 | +- `<tomorrow>` |
| 29 | +- `<yesterday>` |
| 30 | +- `<thismonth>` |
| 31 | +- `<nextmonth>` |
| 32 | +- `<thisquarter>` |
| 33 | +- `<nextquarter>` |
| 34 | +- `<thisyear>` |
| 35 | +- `<nextyear>` |
| 36 | + |
| 37 | +Existing tokens remain supported: |
| 38 | + |
| 39 | +- `<today>` |
| 40 | +- `<thisweek>` |
| 41 | +- `<nextweek>` |
| 42 | +- `<current>` |
| 43 | +- `<choose>` |
| 44 | +- `<select>` |
| 45 | + |
| 46 | +## Examples |
| 47 | + |
| 48 | +Write to tomorrow's daily note: |
| 49 | + |
| 50 | +```yaml |
| 51 | +getNoteTitled: <tomorrow> |
| 52 | +``` |
| 53 | +
|
| 54 | +Write to a date generated by a template expression: |
| 55 | +
|
| 56 | +```yaml |
| 57 | +getNoteTitled: <%- date.tomorrow('YYYY-MM-DD') %> |
| 58 | +``` |
| 59 | +
|
| 60 | +Write to next month's monthly note: |
| 61 | +
|
| 62 | +```yaml |
| 63 | +getNoteTitled: <nextmonth> |
| 64 | +``` |
| 65 | +
|
| 66 | +Write to a rendered monthly note title: |
| 67 | +
|
| 68 | +```yaml |
| 69 | +getNoteTitled: <%- date.now('YYYY-MM', '1m') %> |
| 70 | +``` |
| 71 | +
|
| 72 | +Write to next quarter's quarterly note: |
| 73 | +
|
| 74 | +```yaml |
| 75 | +getNoteTitled: <nextquarter> |
| 76 | +``` |
| 77 | +
|
| 78 | +Write to a rendered yearly note title: |
| 79 | +
|
| 80 | +```yaml |
| 81 | +getNoteTitled: 2026 |
| 82 | +``` |
| 83 | +
|
| 84 | +## Boundary Behavior |
| 85 | +
|
| 86 | +Relative tokens are calculated with calendar-aware date math: |
| 87 | +
|
| 88 | +- On `2024-12-31`, `<nextmonth>` resolves to `2025-01`. |
| 89 | +- On `2024-12-31`, `<nextquarter>` resolves to `2025-Q1`. |
| 90 | +- On `2024-12-31`, `<nextyear>` resolves to `2025`. |
| 91 | + |
| 92 | +Month, quarter, and year notes use NotePlan calendar note formats (`YYYY-MM`, `YYYY-Qn`, `YYYY`) and open/write using the corresponding calendar timeframe. |
| 93 | + |
| 94 | +## Documentation Notes |
| 95 | + |
| 96 | +When documenting rendered template expressions, prefer explicit output formats: |
| 97 | + |
| 98 | +```yaml |
| 99 | +getNoteTitled: <%- date.tomorrow('YYYY-MM-DD') %> |
| 100 | +``` |
| 101 | + |
| 102 | +Avoid relying on `date.tomorrow()` without a format when the target must be a calendar note, because the user's default templating date format may not be `YYYY-MM-DD`. |
| 103 | +# Temporary Docs Handoff: TemplateRunner Calendar Targets |
| 104 | + |
| 105 | +This temporary note summarizes the `np.Templating` 2.4.0 updates for documentation work. It can be removed after the public docs are updated. |
| 106 | + |
| 107 | +## Summary |
| 108 | + |
| 109 | +`TemplateRunner` frontmatter field `getNoteTitled` can now target calendar notes more directly. |
| 110 | + |
| 111 | +Previously, `getNoteTitled` handled a few special targets such as `<today>`, `<thisweek>`, `<nextweek>`, `<current>`, `<choose>`, and `<select>`. Daily dates rendered from template tags, such as `2026-05-03`, could fall through to regular project-note title lookup. |
| 112 | + |
| 113 | +Now, after template tags in `getNoteTitled` are rendered, valid calendar note titles route to calendar notes instead of regular note title lookup. |
| 114 | + |
| 115 | +## Supported Calendar Title Formats |
| 116 | + |
| 117 | +These rendered values are treated as calendar note targets: |
| 118 | + |
| 119 | +- Daily: `YYYY-MM-DD`, for example `2026-05-03` |
| 120 | +- Monthly: `YYYY-MM`, for example `2026-06` |
| 121 | +- Quarterly: `YYYY-Qn`, for example `2026-Q3` |
| 122 | +- Yearly: `YYYY`, for example `2026` |
| 123 | + |
| 124 | +Invalid date-shaped values are not treated as calendar notes. For example, `2024-99-99`, `2024-13`, and `2024-Q5` are rejected by strict validation and continue through the normal handling path. |
| 125 | + |
| 126 | +## New Relative Tokens |
| 127 | + |
| 128 | +`getNoteTitled` now supports these additional relative calendar tokens: |
| 129 | + |
| 130 | +- `<tomorrow>` |
| 131 | +- `<yesterday>` |
| 132 | +- `<thismonth>` |
| 133 | +- `<nextmonth>` |
| 134 | +- `<thisquarter>` |
| 135 | +- `<nextquarter>` |
| 136 | +- `<thisyear>` |
| 137 | +- `<nextyear>` |
| 138 | + |
| 139 | +Existing tokens remain supported: |
| 140 | + |
| 141 | +- `<today>` |
| 142 | +- `<thisweek>` |
| 143 | +- `<nextweek>` |
| 144 | +- `<current>` |
| 145 | +- `<choose>` |
| 146 | +- `<select>` |
| 147 | + |
| 148 | +## Examples |
| 149 | + |
| 150 | +Write to tomorrow's daily note: |
| 151 | + |
| 152 | +```yaml |
| 153 | +getNoteTitled: <tomorrow> |
| 154 | +``` |
| 155 | + |
| 156 | +Write to a date generated by a template expression: |
| 157 | + |
| 158 | +```yaml |
| 159 | +getNoteTitled: <%- date.tomorrow('YYYY-MM-DD') %> |
| 160 | +``` |
| 161 | + |
| 162 | +Write to next month's monthly note: |
| 163 | + |
| 164 | +```yaml |
| 165 | +getNoteTitled: <nextmonth> |
| 166 | +``` |
| 167 | + |
| 168 | +Write to a rendered monthly note title: |
| 169 | + |
| 170 | +```yaml |
| 171 | +getNoteTitled: <%- date.now('YYYY-MM', '1m') %> |
| 172 | +``` |
| 173 | + |
| 174 | +Write to next quarter's quarterly note: |
| 175 | + |
| 176 | +```yaml |
| 177 | +getNoteTitled: <nextquarter> |
| 178 | +``` |
| 179 | + |
| 180 | +Write to a rendered yearly note title: |
| 181 | + |
| 182 | +```yaml |
| 183 | +getNoteTitled: 2026 |
| 184 | +``` |
| 185 | + |
| 186 | +## Boundary Behavior |
| 187 | + |
| 188 | +Relative tokens are calculated with calendar-aware date math: |
| 189 | + |
| 190 | +- On `2024-12-31`, `<nextmonth>` resolves to `2025-01`. |
| 191 | +- On `2024-12-31`, `<nextquarter>` resolves to `2025-Q1`. |
| 192 | +- On `2024-12-31`, `<nextyear>` resolves to `2025`. |
| 193 | + |
| 194 | +Month, quarter, and year notes use NotePlan calendar note formats (`YYYY-MM`, `YYYY-Qn`, `YYYY`) and open/write using the corresponding calendar timeframe. |
| 195 | + |
| 196 | +## Documentation Notes |
| 197 | + |
| 198 | +When documenting rendered template expressions, prefer explicit output formats: |
| 199 | + |
| 200 | +```yaml |
| 201 | +getNoteTitled: <%- date.tomorrow('YYYY-MM-DD') %> |
| 202 | +``` |
| 203 | + |
| 204 | +Avoid relying on `date.tomorrow()` without a format when the target must be a calendar note, because the user's default templating date format may not be `YYYY-MM-DD`. |
0 commit comments