docker-mdbook icon indicating copy to clipboard operation
docker-mdbook copied to clipboard

Compose fails if book uses Mermaid

Open cusma opened this issue 1 year ago • 3 comments

Using the suggested compose.yml with a book that uses mdbook-mermaid, docker compose up fails with the following error:

[+] Running 1/0
 ✔ Container mdbook  Created                                                                                                                                                                                                                     0.0s 
Attaching to mdbook
mdbook  | 2024-06-14 10:31:06 [INFO] (mdbook::book): Book building has started
mdbook  | 2024-06-14 10:31:06 [INFO] (mdbook::book): Running the html backend
mdbook  | 2024-06-14 10:31:06 [ERROR] (mdbook::utils): Error: Rendering failed
mdbook  | 2024-06-14 10:31:06 [ERROR] (mdbook::utils):  Caused By: Unable to copy across additional CSS and JS
mdbook  | 2024-06-14 10:31:06 [ERROR] (mdbook::utils):  Caused By: Unable to copy /book/mermaid.min.js to /book/book/mermaid.min.js
mdbook  | 2024-06-14 10:31:06 [ERROR] (mdbook::utils):  Caused By: No such file or directory (os error 2)
mdbook exited with code 101

cusma avatar Jun 14 '24 10:06 cusma

I have updated the instructions. We need the mermaid.min.js at the same level as book.toml. Please refer to the example project.

cd ./example

# Run "mdbook serve"
docker compose up

# Run "mdbook build"
docker compose run --rm mdbook build

peaceiris avatar Jul 04 '24 17:07 peaceiris

We can also consider the following.

  • https://github.com/peaceiris/docker-mdbook/issues/130

peaceiris avatar Jul 04 '24 17:07 peaceiris

We can also consider the following.

I think this would be the best approach.

cusma avatar Jul 04 '24 19:07 cusma