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

Support title option in mermaid MyST directive #108

Open
kdeldycke opened this issue Feb 18, 2023 · 1 comment
Open

Support title option in mermaid MyST directive #108

kdeldycke opened this issue Feb 18, 2023 · 1 comment

Comments

@kdeldycke
Copy link
Contributor

The mermaid documentation propose to use the title: option to add a title to the produced graph, in the form of:

---
title: Node
---
flowchart LR
    id

Now I'm trying to use this syntax to render a diagram in Sphinx with a MyST directive:

```{mermaid}
---
title: click_extra.platforms.NON_OVERLAPPING_GROUPS
---
sequenceDiagram
    participant Alice
    participant Bob
    Alice->John: Hello John, how are you?
```

Unfortunately the title: option is not recognized by the sphinxcontrib-mermaid extension and produce the following error:

$ poetry run sphinx-build -b html ./docs ./docs/html
Running Sphinx v5.3.0
loading pickled environment... done
myst v0.18.1: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=['colon_fence'], disable_syntax=[], all_links_external=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, highlight_code_blocks=True, number_code_blocks=[], title_to_header=False, heading_anchors=None, heading_slug_func=None, footnote_transition=True, words_per_minute=200, sub_delimiters=('{', '}'), linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area')
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] platforms                                                                                                                                                                                
~/click-extra/docs/platforms.md:7: ERROR: Directive 'mermaid': Unknown option: title

---
title: click_extra.platforms.NON_OVERLAPPING_GROUPS
---
sequenceDiagram
    participant Alice
    participant Bob
    Alice->John: Hello John, how are you?
~/click-extra/docs/platforms.md:19: ERROR: Directive 'mermaid': Unknown option: title
(...)
@kdeldycke
Copy link
Contributor Author

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

1 participant