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

Date 2019-02-18 is a Thursday

Date 2019-02-18 is a Monday

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

Date 2020-02-18 is a Thursday

Date 2020-02-18 is a Tuesday

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.03 00.02 MarkupToHTML begin
 3: 00.03 00.02 MarkupToHTML begin
 4: 00.04 00.03 MarkupToHTML end
 5: 00.04 00.03 MarkupToHTML begin
 6: 00.04 00.03 MarkupToHTML end
 7: 00.04 00.03 MarkupToHTML begin
 8: 00.04 00.04 MarkupToHTML end
 9: 00.05 00.04 MarkupToHTML end
10: 00.05 00.04 MarkupToHTML begin
11: 00.06 00.05 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
12: 00.06 00.05 ReadApprovedUrls SiteAdmin.ApprovedUrls end
13: 00.07 00.06 MarkupToHTML end
14: 00.07 00.06 MarkupToHTML begin
15: 00.07 00.06 MarkupToHTML end
16: 00.07 00.06 now
Peak memory: 3,150,912 bytes