---
title       : Rendering Graphviz in MacDown
author      : jms1
date        : 2021-01-03
categories  :
    - Mac
    - Reference
description : How to render a Graphviz diagram in MacDown
---

This document shows how to use MacDown's built-in support for rendering Graphviz diagrams.

# Rendering Graphviz in MacDown

While looking for something else, I noticed that the [MacDown](https://macdown.uranusjr.com/) preferences screen has an option to render Graphviz 

## Configuring MacDown

* MacDown &#x2794; Preferences
* Click "Rendering" on the toolbar
* Make sure "Syntax highlighted code block" is enabled
* Turn on "Graphviz"

![Settings](macdown-graphviz-settings.png)

## Example

### Markdown

Requires either "`dot`" or "`graphviz`" as the language specifier

~~~
```graphviz
digraph {
    rankdir = LR
    a -> b1
    a -> b2
    b1 -> c
    b2 -> c
}
```
~~~

### Rendered

```graphviz
digraph {
    rankdir = LR
    a -> b1
    a -> b2
    b1 -> c
    b2 -> c
}
```

# Changelog

**2021-11-21** jms1

- Added "Configuring MacDown" section.
- Clarified that Graphviz rendering only works for code blocks with "`dot`" or "`graphviz`" language specifiers.
- Made the example a *little* more complex.
- Fixed a minor formatting error that was preventing everything below the rendered diagram from working.

**2021-01-03** jms1

- Initial version.
