Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 1.14 KB

README.md

File metadata and controls

74 lines (53 loc) · 1.14 KB

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

The following diagram shows the important link between the letters X and Y:

```d2
x -> y
```

{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
  }
}
```

To-dos

  • Option for hand-drawn rendering

More Goldmark Extensions