markdown-preview.nvim
markdown-preview.nvim copied to clipboard
How to config mermaid.flowchartConfig?
" options for markdown render
" mkit: markdown-it options for render
" katex: katex options for math
" uml: markdown-it-plantuml options
" maid: mermaid options
" disable_sync_scroll: if disable sync scroll, default 0
" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
" middle: mean the cursor position alway show at the middle of the preview page
" top: mean the vim top viewport alway show at the top of the preview page
" relative: mean the cursor position alway show at the relative positon of the preview page
" hide_yaml_meta: if hide yaml metadata, default is 1
" sequence_diagrams: js-sequence-diagrams options
let g:mkdp_preview_options = {
\ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {},
\ 'disable_sync_scroll': 0,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1,
\ 'sequence_diagrams': {},
\ 'flowchart_diagrams': {}
\ }
use above option
@iamcco Didn't get it, can't see any settings related to my question. I have tried something like:
'maid' : {'width' : 100},
or
'maid' : {'width' : '100%'},
But none of these worked.
It only support config by initialize function by now. http://mermaid-js.github.io/mermaid/#/usage?id=using-the-mermaidapiinitializemermaidinitialize-call
I don't know if this option can be pass to initialize.
Here's one solution, add directives config using init:
```mermaid
%%{init: {'flowchart': {'useMaxWidth':false}}}%%
Check mermaid docs for directives
Another one, add maid config in the vim configuration(should work, but failed for me):
let g:mkdp_preview_options = {
'maid': {"flowchart":{"useMaxWidth":"false"}}
\}
Good luck.
it doesn't work~~~