dylanowen / mdbook-graphviz

Mozilla Public License 2.0
44 stars 9 forks source link

macOS - can't find the `dot` command #87

Closed yatesco closed 6 months ago

yatesco commented 1 year ago

Hi there! I get the following when I run mdbook serve or mdbook build: "The command wasn't found, is the 'graphviz' preprocessor installed?".

I have installed brew graphviz and which dot: /usr/local/bin/dot.

My book.toml:

[book]
authors = ["Colin Yates"]
language = "en"
multilingual = false
src = "src"
title = "XXX"

[preprocessor.mermaid]
command = "mdbook-mermaid"

[preprocessor.graphviz]
command = "mdbook-graphviz"
after = ["links"]

[output.html]
# additional-js = ["mermaid.min.js", "mermaid-init.js"]

and my chapter.md (replaced backticks in the following with normal ticks to avoid breaking formatting!):

# Modularity

'''dot
{{#include ../crate-graph.dot}}
'''

What actually gets rendered is the contents of the dot file:

image

When I mdbook serve I also see the following warning:

2023-09-25 16:24:14 [INFO] (mdbook::book): Book building has started
Warning: The mdbook-mermaid preprocessor was built against version 0.4.34 of mdbook, but we're being called from version 0.4.28
2023-09-25 16:24:14 [WARN] (mdbook::preprocess::cmd): The command wasn't found, is the "graphviz" preprocessor installed?
2023-09-25 16:24:14 [WARN] (mdbook::preprocess::cmd):   Command: mdbook-graphviz

Thanks! Any suggestions?

Cypher1 commented 6 months ago

Please read the documentation as this is described there. This plugin does not take over all dot rendering (as you may wish to render highlighted dot content). Instead the markup is dot process e.g.

    ```dot process
    digraph {
        a -> b
    }


I think this can be closed now.