Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config value mermaid_sequence_config not parsed correctly #103

Open
fpreiss opened this issue Dec 21, 2022 · 1 comment
Open

Config value mermaid_sequence_config not parsed correctly #103

fpreiss opened this issue Dec 21, 2022 · 1 comment

Comments

@fpreiss
Copy link

fpreiss commented Dec 21, 2022

When trying to override the sequence diagram configuration with the mermaid_sequence_config
option, sphinx will give the following warning:

WARNING: The config value `mermaid_sequence_config' has type `str', defaults to `bool'.

At the time sphinx tries to write the output, it crashes with the following exception:

writing output... [ 87%] pages/examples
Exception occurred:
  File "VENVPATH/lib/python3.10/site-packages/sphinxcontrib/mermaid.py", line 182, in render_mm
    mm_args.extend("--configFile", self.builder.config.mermaid_sequence_config)
TypeError: list.extend() takes exactly one argument (2 given)

For my use case I found a workaround by passing the configFile parameter directly to the
parameter list mermaid_params:

mermaid_params = [
    "--configFile",
    "docs/_static/mermaid_config.json",
]
@jswongF5
Copy link

@fpreiss, What does your mermaid_config.json file look like? I don't see the same error message as you during the build when I use mermaid_sequence_config (I do see the same WARNING). I seem to unable to get it even loaded at all using the workaround (at least I doesn't seem like it is).

My mermaid config, docs/_static/mermaid_config.json:

{
    "theme": "dark"
}

And in my conf.py:

mermaid_params = [
    "--configFile",
    "docs/_static/mermaid_config.json",
]

If I do this in the actual mermaid diagram, it works.

.. mermaid::

   %%{init: {
      "theme": "dark"
   }}%%
   graph TD;
      A--->B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants