astro-d2 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,10 @@ export const AttributesSchema = z
18
18
  .string()
19
19
  .optional()
20
20
  .transform((value) => (value === 'false' ? false : value)),
21
+ /**
22
+ * Overrides the global `layout` configuration for the diagram.
23
+ */
24
+ layout: z.union([z.literal('dagre'), z.literal('elk'), z.literal('tala')]).optional(),
21
25
  /**
22
26
  * Overrides the global `pad` configuration for the diagram.
23
27
  */
package/libs/d2.ts CHANGED
@@ -63,7 +63,7 @@ export async function generateD2Diagram(
63
63
  await exec(
64
64
  'd2',
65
65
  [
66
- `--layout=${config.layout}`,
66
+ `--layout=${attributes.layout ?? config.layout}`,
67
67
  `--theme=${attributes.theme ?? config.theme.default}`,
68
68
  `--sketch=${attributes.sketch ?? config.sketch}`,
69
69
  `--pad=${attributes.pad ?? config.pad}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-d2",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "description": "Astro integration and remark plugin to transform D2 Markdown code blocks into diagrams.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",