MarkupExpressions

Try embedded Markup Expressions

Try embedded Markup Expressions

(:CurrentYear:(ftime fmt=%Y when=tomorrow):)

Date {{$:CurrentYear}}-02-14 is a {(ftime fmt="%A" when='{$:CurrentYear}-02-14')} 

Date {{$:CurrentYear}}-02-18 is a {(ftime fmt="%A" when="{$:CurrentYear}-02-18")}

Date {{$:CurrentYear}}-02-18 is a {(ftime fmt="%A" when={$:CurrentYear}-02-18)}

Date 2023-02-14 is a Friday

Date 2023-02-18 is a Friday

Date 2023-02-18 is a Saturday

(:NextYear:(ftime fmt="%Y" when="next year"):)

Date {{$:NextYear}}-02-14 is a {(ftime fmt="%A" when='{$:NextYear}-02-14')} 

Date {{$:NextYear}}-02-18 is a {(ftime fmt="%A" when="{$:NextYear}-02-18")}

Date {{$:NextYear}}-02-18 is a {(ftime fmt="%A" when={$:NextYear}-02-18)}

Date 2024-02-14 is a Friday

Date 2024-02-18 is a Friday

Date 2024-02-18 is a Sunday

What I learned:

  • Don't include braces in PTV definition.
  • Add braces to stand-alone references.
  • Don't put quotation marks around embedded embedded PTV reference so it can "execute".

The problem with substr:

expression broken because of space in string
:First try didn't work: "{(substr {$:Last} 0 1)}" 

:Add quotes to fix: "{(substr "{$:Last}" 0 1)}" 

(:Last:the end:)
First try didn't work
""
Add quotes to fix
"t"
 0: 00.00 00.00 config start
 1: 00.01 00.01 config end
 2: 00.20 00.20 MarkupToHTML begin
 3: 00.20 00.20 MarkupToHTML begin
 4: 00.21 00.20 MarkupToHTML end
 5: 00.21 00.20 MarkupToHTML begin
 6: 00.21 00.21 MarkupToHTML end
 7: 00.21 00.21 MarkupToHTML begin
 8: 00.21 00.21 MarkupToHTML end
 9: 00.22 00.21 MarkupToHTML end
10: 00.22 00.22 MarkupToHTML begin
11: 00.23 00.22 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
12: 00.23 00.23 ReadApprovedUrls SiteAdmin.ApprovedUrls end
13: 00.24 00.23 MarkupToHTML end
14: 00.24 00.23 MarkupToHTML begin
15: 00.24 00.23 MarkupToHTML end
16: 00.25 00.24 now
Peak memory: 3,486,632 bytes