Diagrams as code

Overview

diagwiz -- ASCII diagrams as code

CI Security audit

Warning: This project is in early experimental stage. Functionality is subject to change and YMMV. Feel free to open an issue if you have any suggestions, Rust tips & tricks (my first Rust project) or stumbled upon any bugs.

Supported diagrams

Installation

As the package is currently in experimental stage, you can install it by building it from the source or by downloading the pre-compiled binary from the latest nightly release.

Download a nightly binary

Visit the nightly release page and download a binary compatible with your system.

Install from source

cargo install --git https://github.com/kjagiello/diagwiz

Usage example

$ cat <<EOF > example.diag
alias ali = "Alice"

ali->Bob: "Hello!"
Bob->Bob: "(Bob thinks)"
Bob->ali: "Hello back!"
EOF

$ diagwiz < example.diag
┌───────┐        ┌─────┐
│ Alice │        │ Bob │
└───────┘        └─────┘
    │    Hello!     │
    │──────────────▶│
    │               │
    │               │─┐
    │               │ │ (Bob thinks)
    │               │◀┘
    │               │
    │  Hello back!  │
    │◀──────────────│
    │               │
┌───────┐        ┌─────┐
│ Alice │        │ Bob │
└───────┘        └─────┘

Known issues

  • Characters with a column width other than 1 cause artifacts in the ASCII representation of a diagram
  • For some inputs, the generated layout might change on every run. This is due to the Cassowary algorithm implementation not being deterministic and finding multiple optimal solutions for the given constraints.
Comments
  • Bump postcss from 8.2.9 to 8.2.15 in /site

    Bump postcss from 8.2.9 to 8.2.15 in /site

    Bumps postcss from 8.2.9 to 8.2.15.

    Release notes

    Sourced from postcss's releases.

    8.2.15

    8.2.14

    • Removed source-map from client-side bundle (by @​barak007).

    8.2.13

    • Fixed ReDoS vulnerabilities in source map parsing (by @​yetingli).

    8.2.12

    • Fixed package.json exports.

    8.2.11

    • Fixed DEP0148 warning in Node.js 16.
    • Fixed docs (by @​semiromid).

    8.2.10

    Changelog

    Sourced from postcss's changelog.

    8.2.15

    8.2.14

    • Removed source-map from client-side bundle (by Barak Igal).

    8.2.13

    • Fixed ReDoS vulnerabilities in source map parsing (by Yeting Li).

    8.2.12

    • Fixed package.json exports.

    8.2.11

    • Fixed DEP0148 warning in Node.js 16.
    • Fixed docs (by @​semiromid).

    8.2.10

    • Fixed ReDoS vulnerabilities in source map parsing.
    • Fixed webpack 5 support (by Barak Igal).
    • Fixed docs (by Roeland Moors).
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • dependency upgrade

    dependency upgrade

    vite-plugin-rsw: v1.3.1 supports custom rust crates path, easy to re-organize the structure of the code.

    [my-wasm-app]
    |- [crate] # rust - custom path, starting from the project root path, or outside of `my-wasm-app`
    |	  |-[rsw-test] # npm package
    |	  |-[@rsw] # npm org
    |	  	  |-[hey] # npm package
    |	  	  |-[other] # npm package
    |	  	  `-... # other package
    |-[src] # front-end
    |- vite.config.ts
    `...
    
    // vite.config.ts
    import { defineConfig } from "vite";
    import ViteRsw from "vite-plugin-rsw";
    + import path from 'path';
    
    export default defineConfig({
      plugins: [
        ViteRsw({
    +	  root: path.resolve('crate'), // rust - custom path
          mode: "release",
          crates: ["@rsw/hey", "@rsw/other", "rsw-test"],
        }),
      ],
    });
    
    opened by lencx 1
  • Add support for dashed message lines

    Add support for dashed message lines

    Also adds support for omnidirectional message arrows. Demo of both features below.

    Input

    ali->bob: "Hello!"
    ali<--bob: "Hello back!"
    

    Output

    ┌──────┐         ┌──────┐ 
    │ ali  │         │ bob  │ 
    └──────┘         └──────┘ 
        │     Hello!     │    
        │───────────────▶│    
        │                │    
        │  Hello back!   │    
        │◀---------------│    
        │                │    
    ┌──────┐         ┌──────┐ 
    │ ali  │         │ bob  │ 
    └──────┘         └──────┘ 
    
    opened by kjagiello 0
  • Implement a web playground

    Implement a web playground

    Exposes a simple web playground at https://diagwiz.io/playground.

    TODO

    • [x] initial design
    • [x] snippet sharing
    • [x] CI
    • [x] Consider using sveltekit
    • [x] Move to https://diagwiz.io/
    • [x] Consider moving to a separate repo
    opened by kjagiello 0
  • How to show block actor

    How to show block actor

    How to block actor

    ┌────────┐        ┌──────┐ 
    │ Alice  │        │ Bob  │ 
    └────────┘        └──────┘ 
         │     Hello!     │    
         │───────────────▶H    
         │                H    
         │  Hello back!   H    
         │◀---------------H    
         │                │    
    ┌────────┐        ┌──────┐ 
    │ Alice  │        │ Bob  │ 
    └────────┘        └──────┘ 
    
    opened by vit1251 1
  • Improve the sequence diagram grammar

    Improve the sequence diagram grammar

    An experimental PR that tries to make the grammar simpler and more consistent at the same time.

    Goals:

    • Provide a way of configuring participants, messages, etc through attributes.
    • Make it possible to associate parts of the generated output with a location in the source code, e.g. clicking on a message in the diagram should select the message in the source code
    opened by kjagiello 0
Owner
Krzysztof Jagiełło
Krzysztof Jagiełło
🏭 Convert Markdown documents into themed HTML pages with support for code syntax highlighting, LaTeX and Mermaid diagrams.

Marky Markdown Magician ?? Features Hot reload previewing ?? Conversion to HTML / PDF ?? Themes! ✨ Extensions - Math, diagrams, syntax-highlighting ??

Vadim 12 Feb 19, 2023
Rust crate for creating beautiful interactive Chord Diagrams

Chord PRO Released Chord PRO is the full-featured chord visualization API, producing beautiful interactive visualizations, e.g. those featured on the

Dr. Shahin Rostami 25 Sep 10, 2022
A library to generate syntax diagrams for Rust macros.

Live demo (code) A browser add-on for Firefox, Chrome and Edge A library to generate syntax ("railroad") diagrams for Rust's macro_rules!(). Diagrams

null 468 Jan 6, 2023
Untree converts tree diagrams produced by tree back into directory file structures.

Untree: Undoing tree for fun and profit Untree converts tree diagrams produced by tree back into directory file structures. Let's say you have the fol

Alecto Irene Perez 91 Jan 1, 2023
Simple, performant graph generator for Feynman diagrams* ⚛️

Feynman diagram generator ⚛️ A simple generator of "Feynman diagram" permutations (as defined by problem 781). Incrementally builds isomorphically uni

eugene huang 3 Jan 1, 2023
PlandUML and Drawio diagrams in doc comments as PNG or SVG images.

rsdoc This crate provides a procedural macro that transform PlandUML and Drawio diagrams in doc comments as PNG or SVG images. The diagrams in doc com

null 4 Feb 20, 2023
deductive verification of Rust code. (semi) automatically prove your code satisfies your specifications!

Le marteau-pilon, forges et aciéries de Saint-Chamond, Joseph-Fortuné LAYRAUD, 1889 About Creusot is a tool for deductive verification of Rust code. I

Xavier Denis 609 Dec 28, 2022
An inquiry into nondogmatic software development. An experiment showing double performance of the code running on JVM comparing to equivalent native C code.

java-2-times-faster-than-c An experiment showing double performance of the code running on JVM comparing to equivalent native C code ⚠️ The title of t

xemantic 49 Aug 14, 2022
unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

unflow 是一个低代码、无代码设计语言。unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

Inherd OS Team (硬核开源小组) 70 Nov 27, 2022
Generate QR code easily for free - QR Code Generation as a Service.

QRcode.show Generate QR code easily for free - QR Code Generation as a Service. INPUT: curl qrcode.show/INPUT curl qrcode.show -d INPUT curl qrcode.sh

Arijit Basu 572 Dec 24, 2022
m2cgen (Model 2 Code Generator) - is a lightweight library which provides an easy way to transpile trained statistical models into a native code

Transform ML models into a native code (Java, C, Python, Go, JavaScript, Visual Basic, C#, R, PowerShell, PHP, Dart, Haskell, Ruby, F#, Rust) with zero dependencies

Bayes' Witnesses 2.3k Dec 31, 2022
A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)

iro -色- A CLI tool to convert the hex color code or RGB to color code, RGB, HSL, color name(if exists, according to jonathantneal/color-names). Usage

Kyohei Uto 3 Dec 9, 2022
languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!

languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments! Overview Install MacO

Dustin Blackman 17 Dec 25, 2022
ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code. It accepts a local path to a folder containing code, and generates a review for each file in the folder and its subdirectories.

Greg P. 15 Apr 22, 2023
Code-shape is a tool for extracting definitions from source code files

Code-shape Code-shape is a tool that uses Tree-sitter to extract a shape of code definitions from a source code file. The tool uses the same language

Andrew Hlynskyi 3 Apr 21, 2023
rehype plugin to use tree-sitter to highlight code in pre code blocks

rehype-tree-sitter rehype plugin to use tree-sitter to highlight code in <pre><code> blocks Contents What is this? When should I use this? Install Use

null 5 Jul 25, 2023
Count your code, quickly.

Tokei (時計) Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code,

null 7.5k Jan 9, 2023
A text editor in ≤1024 lines of code, written in Rust

Kibi: A text editor in ≤1024 lines of code, written in Rust A configurable text editor with UTF-8 support, incremental search, syntax highlighting, li

Ilaï Deutel 881 Dec 29, 2022
An opinionated modal editor to simplify code editing from the terminal

(I'm currently refactoring the platform layer. So we have to first finish this cleanup before we're able to continue adding features) An opinionated m

Matheus Lessa Rodrigues 284 Jan 5, 2023
A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. :zap::crab:

binserve ⚡ ?? A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. ?? UPDATE: N

Mufeed VH 722 Dec 27, 2022