Home

Awesome

Goldmark D2

Go Reference

Goldmark D2 is a Goldmark extension providing diagram support through D2.

Usage

goldmark.New(
	goldmark.WithExtensions(&Extender{
		// Defaults when omitted
		Layout:  d2dagrelayout.Layout,
		ThemeID: d2themescatalog.CoolClassics.ID,
	}),
).Convert(src, dst)

Example

<table> <tr> <td>
The following diagram shows the important link between the letters X and Y:

```d2
x -> y
```
</td> <td>

</td> </tr> <tr> <td>

{Sketch: true}

```d2
dogs -> cats -> mice: chase
replica 1 <-> replica 2
a -> b: To err is human, to moo bovine {
  source-arrowhead: 1
  target-arrowhead: * {
    shape: diamond
  }
}
```
</td> <td>

</td> </tr> </table>

To-dos

More Goldmark Extensions