mgaitan/sphinxcontrib-mermaid

Cannot set 'mermaid_cmd' to multiple words

slanzmich opened this issue · 9 comments

Currently, mermaid_cmd cannot be set to a command containing arguments / multiple words, e.g. npx mmdc. Neither

mermaid_cmd = "npx mmdc"

nor

mermaid_cmd = ["npx", "mmdc"]

work, because the command is always passed as first item of a list to os.Popen.

What do you think about always supporting the second form, and support the first form (by calling shlex.split on string input) if mermaid_cmd_shell is set?

hey @slanzmich , that sounds ok. could you send a PR?

@mgaitan #79 does that. :)

Right, #79 would solve my issue. On the other hand, always splitting the string will break things for people specifying a path containing spaces. To support both, a list of strings should also be accepted. I'll send a PR.

I opened #91 with an alternative implementation.