Skip to content

Use mmdc's ability to read from STDIN #24

@ayorgo

Description

@ayorgo

As mermaid-cli allows piping from STDIN it would be nice to bypass the creation of a temporary file in this mode.

This would make ob-mermaid work with containerized installations without affecting current usage scenarios.

For example, with the following script at /some_path/mmdc:

#!/usr/bin/env sh
docker run --rm -i -u `id -u`:`id -g` -v $(pwd):/data minlag/mermaid-cli:10.6.1 mmdc "$@"

I am able to generate diagrams as follows:

$ cat test.mmd | ./mmdc -o test.png

So if this behaviour was reflected in ob-mermaid.el the following configuration would be enough to make it work with containers:

(setq ob-mermaid-cli-path "/some_path/mmdc")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions