GithubHelp home page GithubHelp logo

ftomassetti / boxchareditor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ogt/boxchareditor

0.0 3.0 0.0 2.39 MB

Box drawing character utility

Home Page: http://ogt.github.io/boxchareditor

License: MIT License

Ruby 0.03% Makefile 0.32% JavaScript 91.78% Batchfile 0.13% HTML 7.73%

boxchareditor's Introduction

Box drawing character utility

Synopsis

Simple utility to make it easier to create lines, line charts, org charts using plain text characters.

Examples

Example

Here are some examples of what you can create:

          +--+                                                              
          |  |                                                              
          ++++                                                              
           ||                                                               
     +==+==++==+==+                                                         
     +==+      +==+                                                         
        |      |                                                            
        |      |                                                            
        +=+===++                                                            
        | +-+ |                                                             
        | | | |                                                             
        | | | |                                                             
        +-+ +-+                                                             

or

  +====+=============+===================+                                  
  |    |             |                   |                                  
  +----+-------------+-------------------+                                  
  |    |             |                   |                                  
  |    |             |                   |                                  
  |    |             |                   |                                  
  +====+=============+===================+                                  

or

               +---------+                                                                                                                                  
               |         |                                                                                                                                  
               +----+----+                                                                                                                                  
                    |                                                                                                                                       
     +--------------+------------+                                                                                                                          
  +--+--+        +--+--+      +--+--+                                                                                                                       
  |     |        |     |      |     |                                                                                                                       
  +--+--+        +--+--+      +--+--+                                                                                                                       
     |   +----+     | +----+     | +----+                                                                                                                   
     +---+    |     +-+    |     +-+    |                                                                                                                   
     |   +----+     | +----+     | +----+                                                                                                                   
     |              |            |              
     |   +----+     | +----+     | +----+                                                                                                                   
     +---+    |     +-+    |     +-+    |                                                                                                                   
     |   +----+     | +----+     | +----+                                                                                                                   
     |              |            |              
     |   +----+     | +----+     | +----+                                                                                                                   
     +---+    |     +-+    |     +-+    |                                                                                                                   
         +----+       +----+       +----+                                                                                                                   

Description

To try it go to http://ogt.github.com/boxchareditor and then use your keyboard arrows to move the yellow cursor around (you may need to click on it to give to the window focus).

When you want to draw a line, keep the SHIFT key pressed while you move the arrows. The line will be using the - dash character to draw the line when moving horizontally and the | bar character to draw vertical lines. Keep the SHIFT and COMMAND (for macs) or META (for pcs) keys pressed to draw a double line using the = equal character.

When a horizontal and a vertical line cross it uses the + plus character. There is no undo, but you can erase what you drew by pressing the ALT key while you move. Erasing is "smart", i.e., it looks at its neighboring cells and fixes anything that need to be fixed after the erase.

Pressing the Restart button does the obvious. There are a few configuration variables that you can change - you will need to press Restart for them to take effect. One of the configuration variables is speed - speed 2 means that a any arrow key pressed is repeated 2 times - so the moving/drawing happens faster.

The drawing happens against an invisible canvas - you control the width and height of it through configuration parameters. You cannot draw outside the canvas. For fonts you shoud probably stick to fixed width fonts.

The purpose of the utility is to allow you to draw relative complex tables/org charts that you then copy and paste into your editor.

Installation

To run locally:

> hub clone ogt/boxchareditor && cd boxchareditor
> npm install
> open index.html

To make changes:

> hub clone ogt/boxchareditor && cd boxchareditor
> npm install
> # make any changes you want
> make bundle 
> open index.html

The step make bundle is needed because the majority of the code is in modules that are being required from other modules. make bundle is flattening the ./main.js into static/bundle.js that is srced by ./index.html. We follow this style to allow the same code to be used by the browser as well as node-tested by test scripts that can be run automatically from services that support nodejs continuous integration (like travis-ci).

Contributions

If you plan to contribute back your changes you should make sure that

  • you add unit tests for all functionality described in the issue
  • you maintain the current code coverage (100%) both in terms of blocks and lines.
  • your code produces no lint errors based on the included .jshintrc.
  • you have updated the README.md file to include any chnages that affect the documentation

Your pull requests will not be reviewed unless it satisfies the above requirements

To get coverage report

> make cover
> open cover_html/index.html

To run lint based on the included .jsinitrc spec

> make lint

To run the tap tests

> make test # or just npm test

Finally (optional step) to recreate the man page (if you don't have ruby's bundle then do gem instal bundle first)

> bundle install
> make man
> man man/boxchareditor.1

Its a good idea to run make all or just make before pushing to make sure that everything has been updated.

If you want an enhancement feel free to add an issue to github.com/ogt/boxchareditor

See also

https://github.com/LearnBoost/cli-table, https://github.com/substack/node-multimeter, https://github.com/substack/picture-tube

Acknowledgments

Copyright

Odysseas Tsatalos, http://tsatalos.gr

Files

https://github.com/ogt/boxchareditor

Build status

Build Status

boxchareditor's People

Contributors

cybercarnage avatar gkamal avatar gulinss avatar mauritsmeijer avatar ogt avatar

Watchers

 avatar  avatar  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.