Giter Site home page Giter Site logo

readme-diagram's Introduction

readme diagrams generator

Generate diagrams in your readme files like this one:

diagram

raw
Note left of user: Create readme with code block and image placeholder
user->generator: Start generator 
Note right of generator: Scans for code blocks and image placeholders
Note right of generator: Creates diagrams
generator->user: Code ready to commit and push

Install

npm install -g readme-diagram

Currently there is an issue with installing electron. If you run across issue Error: EACCES: permission denied, mkdir '<...>readme-diagram/node_modules/electron/.electron' try to install package with command: npm install -g readme-diagram --unsafe-perm=true --allow-root

Usage

In readme file place image holder:

![Some text](relative/path/to/file.svg)

Then after that place a code block with language corresponding to code-name of diagram:

    ```js-sequence-diagram
    Alice->Bob: Hello Bob, how are you?
    Note right of Bob: Bob thinks
    Bob-->Alice: I am good thanks!
    ```

To hide this code block put it into details:

<details><summary>raw</summary>
    ...
</details>

Run generator:

readme-diagram --file my-readme.md

Generator will create diagrams and save them in path from image holder (in this example relative/path/to/file.svg which is relative to readme file).

Supported diagrams and code-names

This tool supports diagrams from https://github.com/francoislaberge/diagrams

diagram type code-name
flowchart js-flowchart-diagram
sequence js-sequence-diagram
dot js-dot-diagram
railroad js-railroad-diagram

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.