Topic on Extension talk:Mermaid

help with SMW query results in Mermaid Gantt

4
Summary by Revansx

SOLVED!!! - happy to report that I figured it out.. turns out that I needed to add the parameter "import-annotation=true" to my #ask.

Revansx (talkcontribs)

trying to generate milestones in a gantt chart with Mermaid using inline SMW querries and the "template" SRF format. I have the following wiki text in a page:

{{#mermaid:gantt
  dateFormat  YYYY/MM/DD
  Overall Project: prj1, {{{has project begin date}}}, {{{has project finish date}}}
  {{#ask:[[Category:Project Milestone]][[relates to page::{{FULLPAGENAME}}]]
    |?has milestone name
    |?has date#-F[Y-m-d]
    |link=none|format=template|template=Mermaid Milestones
  }}
}}

and page "Template:Mermaid Milestone" is simply:

{{{2|Milestone Name}}}: {{{3|2000-01-01}}}, 1d

but it doesn't work.. an inspection of the generated html (view source) shows this:

<div
 id="ext-mermaid-99635bc5204c4b4e1"
 class="ext-mermaid"
 data-mermaid="{"content":"gantt\n
 dateFormat YYYY\/MM\/DD\n
 Overall 2018 SEC EMI IST Test Campaign : fc16491, 2018\/10\/01, 2018\/12\/21\n
 [[SMW::off]]Milestone1: 2018-11-19, 1d[[SMW::on]]","config":{"theme":"forest"}}"
><div class="mermaid-dots"></div></div>

the mermaid code that the SMW #ask statement should have rendered int is this:

{{#mermaid:gantt
  dateFormat  YYYY/MM/DD
  Overall Project: prj1, {{{has project begin date}}}, {{{has project finish date}}}
  Milestone1: 2018-11-19, 1d
}}

The problem seems to be the SMW::off/on

Revansx (talkcontribs)

the text:

Milestone1: 2018-11-19, 1d

is exactly what I'm striving for.. it's just that for some reason i'm getting

[[SMW::off]]Milestone1: 2018-11-19, 1d[[SMW::on]]

which is breaking it.

How do I solve this?

Revansx (talkcontribs)

SOLVED!!! - happy to report that I figured it out.. turns out that I needed to add the parameter "import-annotation=true" to my #ask.

The following now works:


{{#mermaid:gantt
  dateFormat  YYYY/MM/DD
  Overall Project: prj1, {{{has project begin date}}}, {{{has project finish date}}}
  {{#ask:[[Category:Project Milestone]][[relates to page::{{FULLPAGENAME}}]]
    |?has milestone name
    |?has date#-F[Y-m-d]
    |link=none|format=template|template=Mermaid Milestones
    |import-annotation=true
  }}
}}
Revansx (talkcontribs)