Coder Social home page Coder Social logo

aasvg's Introduction

aasvg

Convert ASCII art diagrams into SVG.

This is inspired by goat but rather than a reimplementation, this code uses the original markdeep code.

Usage

Install with npm install -g aasvg.

Feed aasvg an image and it will write an SVG. For example:

$ aasvg < example.txt > example.svg

example

Character Placement

By default, this does not place text characters on a grid one-by-one as the original markdeep code did.

The --spaces command-line argument controls how text is combined. Use either --spaces=0 or --stretch to provide precise text placement.

--spaces=0 ensures that every character is placed separately; which is precise and avoids text distortion, but makes for a larger SVG that is harder to search.

--stretch can be used with --spaces set to any value. --stretch stretches text to fit, which is less widely implemented in viewers (generally you don't have to worry about this unless you are using an insane profile) and might distort the text a tiny bit because the metrics for the font used (the generic "monospace") cannot be exactly controlled.

Dark Backgrounds

This tool draws black lines and text on a transparent background. In certain settings (such as GitHub when a dark mode is enabled), this produces unfortunate results. If you inline the resulting SVG, you can perform tricks with CSS, but if you are using <img>, that isn't possible. Use the --backdrop switch to generate a mostly-white backdrop for the image.

aasvg's People

Contributors

bifurcation avatar martinthomson avatar

Watchers

 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.