Git Product home page Git Product logo

yml2dot's Introduction

yml2dot - Turn YAML into beautiful Graph

Use Cases

  • Visualize your YAML files as Graph
  • Generate additional info from your source code (simply define a YAML block and use this tool)

How yml2dot works?

Takes in input:

  • any YAML file
  • any text file that has YAML between comments (like front matter)

Generates a dot script for Graphviz.

Examples

Visualize a Kubernetes Deployment YAML file

Given a sample deployment.yml file:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

Run yml2dot like this:

$ yml2dot deployment.yml | dot -Tpng > deployment.png

and create this graph:

Grab YAML info embedded in your source code

/*** 
Box:
  Object:
    - set
    - get
***/

public class Box {
    private Object object;

    public void set(Object object) {
        this.object = object;
    }
    public Object get() {
        return object;
    }
}

Use the -from and -to flags to mark your YAML block.

Run yml2dot like this:

$ yml2dot -from '/***' -to '***/' Box.java | dot -Tpng > Box.java.png

and create this graph:

How to install?

If you have golang installed:

$ go install github.com/lucasepe/yml2dot@latest

This will create the executable under your $GOPATH/bin directory.

Ready-To-Use Releases

If you don't want to compile the sourcecode yourself, Here you can find the tool already compiled for:

  • MacOS
  • Linux
  • Windows

yml2dot's People

Contributors

lucasepe avatar bmwtsn098 avatar johnmeyerhoff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.