Home

Awesome

diagon.nvim

Use Diagon within neovim and retain the instructions so they can be modified.

asciicast

Installation

Make sure you have Diagon installed: https://github.com/ArthurSonzogni/Diagon

Use your favorite plugin manager to install diagon.nvim

For Lazy add something like this:

  {
    "mckean/diagon.nvim",
    config = function()
      require("diagon")
    end,
  },

Usage

Currently the following generators are supported

Providing a name is optional but encouraged, especially when using multiple entries in a single document.

The command Diagon will generate the diagram and insert it after the code block. Once placed it can be put anywhere and subsequent calls will update the diagram.

Sequence Diagram

```sequence name
hello -> world: hi!
world -> peace: jey!
```
<!-- sequence_output_name
┌─────┐┌─────┐┌─────┐
│hello││world││peace│
└──┬──┘└──┬──┘└──┬──┘
   │      │      │   
   │ hi!  │      │   
   │─────>│      │   
   │      │      │   
   │      │ jey! │   
   │      │─────>│   
┌──┴──┐┌──┴──┐┌──┴──┐
│hello││world││peace│
└─────┘└─────┘└─────┘
-->

Math Expression

```math name
1+1/2 + sum(i,0,10) = 113/2
```
<!-- math_output_name
        10         
        ___        
    1   ╲       113
1 + ─ + ╱   i = ───
    2   ‾‾‾      2 
         0         
-->