Skip to content

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

License

Notifications You must be signed in to change notification settings

McKean/diagon.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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

  • Sequence Diagram
  • Mathematic Expression

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         
-->

About

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

Resources

License

Stars

Watchers

Forks

Languages