Skip to content

FurqanSoftware/goldmark-d2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages