badboy / mdbook-mermaid

A preprocessor for mdbook to add mermaid support
Mozilla Public License 2.0
306 stars 32 forks source link

Use mdbook-mermaid v0.8.3 on mdbook v0.4.12 #12

Closed rzerres closed 2 years ago

rzerres commented 2 years ago

Describe the bug

When including mdbook-mermaid v0.8.3 (or latestest git version) as a valid preprocessor in the render chain controlled with mdbook v0.4.12 the process returns with ERROR.

To Reproduce

Steps to reproduce the behavior:

$ cd ~/book
$ mdbook-mermaid install

inside ~/book/book.toml the output and preprocessor tables are extended as expected. The mermaid[-init, .min].js are included.

$ RUST_LOG=info  mdbook build --dest-dir=$XDG_RUNTIME_DIR/book --language en

$ 2021-09-20 11:49:40 [ERROR] (mdbook::utils): Error: Unable to parse the preprocessed book from "mermaid" processor
$ 2021-09-20 11:49:40 [ERROR] (mdbook::utils):  Caused By: missing field `chapter_titles` at line 1 column 83887```

Expected behavior

The application should render the book with the mermaid source.

Environment

OS: Arch Linux
Rust version: 1.55.0
mdbook: v0.4.12
mdbook-mermaid: v0.8.3
badboy commented 2 years ago

I can't reproduce that on the mdbook guide nor my own book. (my mdbook doesn't even have a --language flag?!)

When using the pre-built binary of mdbook-mermaid I do correctly see a warning logged:

Warning: The mdbook-mermaid preprocessor was built against version 0.4.10 of mdbook, but we're being called from version 0.4.12

When building mdbook-mermaid myself it will pull in mdbook 0.4.12, so no warning is logged. The chapter_titles is marked as skip, so I'm not sure what's happening.

Where did you get your mdbook from? Is your book public to test with?

rzerres commented 2 years ago

sorry for the noise.

I shouldn't have blamed your preprocessor. Sorry for that, i haven't crosschecked on stock 0.4.12.

I haven compiled on branch localization, which does integrate multilanguage support. Seems there is a regression. Just compiling with clean 0.4.12 renders without issues. I will forward to Runi0x11.

I have tried to figure out, why mdbook::utils complains about a missing field. Yes, in the pipe the produced serde stream skips chapter_titles. This seems to be an issue, if you include it to another preprocessor. At least throwing the error with mdbook-mermaid.

And yes the orbtk-book is pulicy accessible on github.

sanmai-NL commented 2 years ago

@rzerres Can you close the issue?