Draw math formulas in ASCII via command line

Built with C++ and WebAssembly for the Web.


Draw math formulas in ASCII via command line


Diagon is an interactive interpreter. It transforms the expression of markdown style into an ascii art representation.

It was written in C++ and uses WebAssembly, HTML and CSS to make a Web application, in addition to being able to use it via the command line.


Installation

Use Git, CMake, GNU Make and of course GCC or clang to build:

git clone https://github.com/ArthurSonzogni/Diagon
CD Diagon
mkdir build && cd build
cmake..
make

Test the binary before installing:

echo "1+1/2 + sum(i,0,10) = 112/2" | ./diagon-1.0.127 Math

Likely output:

        10         
        ___        
    1   ╲       112
1 + ─ + ╱   i = ───
    2   ‾‾‾      2 
         0   


Finally, install:

sudo make install

It will be installed in the paths:

-- Install configuration: "Release"
-- Installing: /usr/local/bin/diagon-1.0.127
-- Installing: /usr/local/bin/diagon

You can also install via: snap:

sudo snap install diagon

Use --help for more information and run the examples.

The web example will open at http:localhost:8888 . Taking as a reference if you are still inside build/.

Will open in your default browser!

cd ../src
./run_diagon.sh

For more information visit the repository .


cpp cppdaily terminal commands


Share


YouTube channel

Subscribe


Marcos Oliveira

Marcos Oliveira

Software developer
https://github.com/terroo

Related articles