Damus
David Chisnall (*Now with 50% more sarcasm!*) profile picture
David Chisnall (*Now with 50% more sarcasm!*)
@David Chisnall (*Now with 50% more sarcasm!*)
Ugh. Trying to use Mermaid in an AsciiDoctor doc is a world of pain.

Installing asciidoctor-diagram doesn't install its actual dependencies because it's installed via gem and so doesn't know about the system package manager (I hate language-specific package managers so much).

It requires a command called mmdc. This is not the thing provided by the (deprecated) Python package called mmdc that renders Mermaid diagrams, it comes from a node package: mermaid-cli. Well, not actually, mermaid-cli, which is a deprecated and unmaintained package, it's actually @mermaid-js/mermaid-cli.

This, of course, doesn't install because the version of node.js in the Ubuntu base that the container is using is too old, and Ubuntu inherits Debian's policy of version locking all third-party components and never updating them so the 'LTS' releases become unusable well within their support lifetime. Fine, bump the container's base image.

This then crashes on startup. Why? Because, in spite of running in a copy of V8 provided by Node, it also needs another copy of V8 and some other stuff and really renders in Chromium (I have no idea why a thing that converts markup to SVG would need a web browser for that conversion and I do not want to know).

Okay, so install chromium in the container. Same error.

Run an interactive session in the container and try launching chromium (expecting it to fail because it can't connect to a display server, since I didn't pass the right options to run it headless). It doesn't! It exits with an error because the apt package for chromium exists just to tell you that you need to install chromium from a snap.

Fine. I'll install it from the snap. Oh, that requires snapd to be running. But containers don't run a full init system, so don't start snapd and it doesn't start automatically because systemd's socket activation requires systemd to actually be running. Which it isn't, because this is a container.

This entire ecosystem is a joke.
2
✧✦Catherine✦✧ · 3w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqncxka2nmkqkndk4wkuf3tz3l39z9m8xax3aen3h8tvudwgjmf5mq4uv2v2 considering mermaid is now slop maybe it's for the better
Tony Finch · 3w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqncxka2nmkqkndk4wkuf3tz3l39z9m8xax3aen3h8tvudwgjmf5mq4uv2v2 you might find https://github.com/Latias94/merman is easier (i would be interested to hear how well it works if you try it)