Asciio - Plain ASCII diagram | | | | | | | | | | | | | | | | v | v | v | v v v ______ _____ /\ _ \ __ __/\ __`\ \ \ \L\ \ ____ ___ /\_\/\_\ \ \/\ \ -----> \ \ __ \ /',__\ /'___\/\ \/\ \ \ \ \ \ -----> \ \ \/\ \/\__, `\/\ \__/\ \ \ \ \ \ \_\ \ \ \_\ \_\/\____/\ \____\\ \_\ \_\ \_____\ \/_/\/_/\/___/ \/____/ \/_/\/_/\/_____/ | | | | | | | | | | | v | | | v | | | v | | | v | | v v v (\_/) (O.o) ASCII world domination is near! (> <)
$> perl asciio.pl
This gtk2-perl application allows you to draw ASCII diagrams in a modern (but simple) graphical application. The ASCII graphs can be saved as ASCII or in a format that allows you to modify them later.
Thanks to all the Perl-QA hackathon 2008 in Oslo for pushing me to do an early release.
Special thanks go to Gábor Szabó for his help and advices. Adam Kennedy coined the cool name.
Sometimes a diagram is worth a lot of text in a source code file. It has always been painfull to do ASCII diagrams by hand. The simple example below comes from a module I wrote a few years ago. I remember cursing a few times then I tried to draw the graph in a program made for non ASCII diagrams and convert the XML output to ASCII. That still didn't work so nicely. A diagram as simple as the one below can take a lot of time, specially if you have to modify it.
default elements in an empty diagram .------------------------. | | | | | | .-------|---------------|--------|------------------------------------------. | | | | asciio | |-------|---------------|--------|------------------------------------------| | ......v---------......v........v......................................... | | .....| |..edit_me....--->....................................... | | .....'----------'........................................................ | | ......................................................................... | | ...................----------------..---------------..................... | | ..................| ASCII > || thin_box |.................... | | ..................| Rules line > || text |.................... | | ..................| Load || wirl_arrow |.................... | grid------------->..........| Save || arrow |.----------......... | | ..................| Export > || box > || star_box |........ | | ..................'----------------'| Rulers > |'----------'........ | | ...........................^........| Misc > |.................... | | ...........................|........| T_star |.................... | | ...........................|........'---------------'.................... | | ...........................|............................................. | | ...........................|............................................. | | ...........................|............................................. | | ...........................|............................................. | | ...........................|............................................. | | ...........................|............................................. | '----------------------------|----------------------------------------------' | context menu
The context menu allows to access to asciio commands. ASCII is used to insert ASCII elements.
All the keyboad commands definitions can be found under asciio/setup/actions/. Among the commands implemented are:
select all
delete
undo
group/ungroup
open / save
local clipboard operations
A window displaying the currently aailable commands is displayed if you press CTL+K.
There but a few elements implemented at the moment.
An arrow that tries to do what you want. Try rotating the end clockwise then counter clockwise to see how it acts
^ | | --------. | | '------- | | O-------------X / | / | / | / v / / v
Both are implemented within the same code. Try double clicking on a box to see what you can do with it.
.----------. | title | .----------. |----------| ************ | | | body 1 | * * '----------' | body 2 | ************ '----------' anything in a box (\_/) | edit_me (O.o) <------------' (> <)
For simple elemnts, put your design in a box. that should cover 90% of anyone's needs. You can look in lib/stripes for element implementation examples.
In the context menu un Export, you can export to a file in ASCII format but using the .txt extension.
There is much to be done. I didn't think I'd spend so much time writting asciio to start with and I can see it's going to take much more work. Still it's quite usable for a quick application. You are very welcome to give me feedback and even join in the development of asciio. For Christmas(tm), I'll iron out the last problems and do some refactoring. I'll then add support for externally defined routing mechanisms and will work on a wirl arrow that has more than two segments.
User code ^ ^ OS code \ / \ / \ / User code <----Mode----->OS code / \ / \ / \ User code v v OS code .---. .---. .---. .---. .---. .---. OS API '---' '---' '---' '---' '---' '---' | | | | | | v v | v | v .------------. | .-----------. | .-----. | Filesystem | | | Scheduler | | | MMU | '------------' | '-----------' | '-----' | | | | v | | v .----. | | .---------. | IO |<----' | | Network | '----' | '---------' | | | v v v .---------------------------------------. | HAL | '---------------------------------------' .---------. .---------. | State 1 | | State 2 | '---------' '---------' ^ \ ^ \ / \ / \ / \ / \ / \ / \ / \ / \ / v v ****** ****** ****** * T1 * * T2 * * T3 * ****** ****** ****** ^ ^ / \ \ / \ \ / \ \ / stimuli \ \ / \ \ v \ .---------. '--------| State 3 | '---------'
gnome libraries, gtk, gtk-perl, perl
Undoubtedly many as I wrote this as a fun little project where I used no design nor 'methodic' whatsoever.
Khemir Nadim ibn Hamouda CPAN ID: NKH mailto:nadim@khemir.net
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://www.jave.de http://search.cpan.org/~osfameron/Text-JavE-0.0.2/JavE.pm http://ditaa.sourceforge.net/ http://www.codeproject.com/KB/macros/codeplotter.aspx http://search.cpan.org/~jpierce/Text-FIGlet-1.06/FIGlet.pm http://www.fossildraw.com/?gclid=CLanxZXxoJECFRYYEAodnBS8Dg (doesn't always respond)
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Gábor'. Assuming CP1252
To install App::Asciio, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Asciio
CPAN shell
perl -MCPAN -e shell install App::Asciio
For more information on module installation, please visit the detailed CPAN module installation guide.