Configuration
All Rehype diagram plugins support (at least) following configurations:
strategy(optional). DefaultinlinedarkScheme(optional). Defaultundefinedtag(optional). Defaultimg. Ignored forstrategy=inlinecache(optional) - Map-like storage to speed up consequent renders of page. You can use standard JSMap, but probably it is better to use @beoe/cache.class(optional) - allows to setup additional classes for diagrams. For example,.not-contentfor inline diagrams if you use tailwindcss-typographysvgo(optional) - options for SVGO. Usefalseto disable optimization with SVGO
All configurations can be set either globally or locally (via fence-code meta). Global configurations applies to all diagrams. Local configurations applies only to one diagram. Local configurations always override global, with exception for class option (it applies all provided classes).
Also you won’t be able to set cache and svgo via local configurations, except disabling them with false value.
Global configuration
For example,
import { getCache } from "@beoe/cache";const cache = await getCache();
use(rehypeDiagram, { strategy: "file", darkScheme: "class", class: "something", cache,});Local configuration
```some-diagram strategy=inline darkScheme=false class=interactive...```