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 2020-02-14 is a Thursday

Date 2020-02-18 is a Thursday

Date 2020-02-18 is a Tuesday

(: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 2021-02-14 is a Thursday

Date 2021-02-18 is a Thursday

Date 2021-02-18 is a Thursday

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.00 00.00 config end
 2: 00.11 00.11 MarkupToHTML begin
 3: 00.12 00.11 MarkupToHTML begin
 4: 00.13 00.12 MarkupToHTML end
 5: 00.13 00.12 MarkupToHTML begin
 6: 00.13 00.12 MarkupToHTML end
 7: 00.13 00.12 MarkupToHTML begin
 8: 00.13 00.12 MarkupToHTML end
 9: 00.14 00.13 MarkupToHTML end
10: 00.14 00.14 MarkupToHTML begin
11: 00.15 00.14 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
12: 00.16 00.15 ReadApprovedUrls SiteAdmin.ApprovedUrls end
13: 00.16 00.15 MarkupToHTML end
14: 00.16 00.15 MarkupToHTML begin
15: 00.17 00.16 MarkupToHTML end
16: 00.17 00.16 now
Peak memory: 3,181,064 bytes