Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create DSL language #675

Open
artefactop opened this issue Apr 6, 2022 · 1 comment
Open

Create DSL language #675

artefactop opened this issue Apr 6, 2022 · 1 comment

Comments

@artefactop
Copy link

artefactop commented Apr 6, 2022

Hi there,

I like diagrams and I want to use it for my company documentation, we create the documentation as Markdown inside /docs folder (we use MkDocs to render it later). The workflow I want to build is the following:

  • Developer creates/updates the diagram in /docs/diagrams along with the code changes
  • Once is merged to main branch, the CI render that to images and publish to our internal web server

So currently I have to add a previous step of Markdown to web render to build the diagrams images.

Proposal:
Would be great to create a DSL language for diagrams. That way, we can create a Markdown plugin for python and included it on MkDocs and render everything in just one step.

Benefits:

  • We could add the diagrams inline with the markdown documentation

So we can pass from:

# diagram.py
from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Web Service", show=False):
    ELB("lb") >> EC2("web") >> RDS("userdb")

To:

diagram "Web Service" {
}

aws.network.elb "lb" {
  diagram = "Web Service"
  link_to = "web"
}

aws.compute.ec2 "web" {
  diagram = "Web Service"
  link_to = "userdb"
}

aws.database.rds "userdb" {
  diagram = "Web Service"
}
  • It can be extensible for other languages apart from python (and go-diagrams)
  • You don't need to have separate files for diagrams and a pre-render step
  • Developers do not need to learn several implementations, for example imagine, ruby, kotlin, etc... developers can work with the same diagram.

A good start point to build the language will be HashiCorp configuration language

@bytehello
Copy link

This is a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants