[SLL] Character based drawing tool
(Ted Harding)
Ted.Harding at manchester.ac.uk
Sat Mar 7 18:06:26 PST 2009
I seem to have missed the start of this thread. For response,
see at end.
On 08-Mar-09 01:02:18, Ben. B. wrote:
> Have a look at Asciio off of the CPAN. I've never tried it but I guess
> it's
> basically Visio but for ascii.
>
> On Sat, Mar 7, 2009 at 1:48 AM, Paul Franz <paul at eucleides.com> wrote:
>
>> I'm looking for a text based drawing tool that will make creating
>> drawings
>> like this
>> easy.
>>
>>
>>
>> 192.168.1.10 192.168.1.5
>> +----------+ +----------+
>> | Desktop | | Server |
>> +-----+----+ +-----+----+
>> | | eth1 eth0 192.168.1.1
>> | | +----------+ +----------+
>> +-------------+---------| Firewall |-----| Router |--
>> Internet
>> +----------+ +----------+
>>
>> Any ideas?
>>
>> I'm not rigid on having it produce a character based drawing.
>> Postscript, html, or png output would be fine too. Just that
>> character based makes it easier for inclusion in README files
>> and man pages.
>> --
>> Paul Franz
>> 425.440.9505 (O)
>> 425.241.1618 (C)
You already have the perfect tool for the job on any Linux
system, namely 'groff' along with its companion 'pic'.
(And, by the way, groff is what formats man-pages anyway).
First, create the following file "lan.tr" using any plain
text editor:
lan.tr:
8<----------------------------------------------
.LP
.PS
box wid 1 ht 0.3 "Desktop"
"192.168.1.10" " " at last box.n
box wid 1 ht 0.3 "Server" with .w at last box.e + (0.2,0)
"192.168.1.5" " " at last box.n
box wid 1 ht 0.3 "Firewall" with .nw at last box.se + (0.30,-0.3)
"eth1" ljust " " at last box.nw
"eth0" rjust " " at last box.ne
box wid 1 ht 0.3 "Router" with .w at last box.e + (0.5,0)
"192.168.1.1" " " at last box .n
line from 4th last box .s down 0.45 then right 2.0
line from 3rd last box .s down 0.45
line from 2nd last box .e to last box .w
line invis right 0.80 from last box.e
line right 0.3 from last box.e
" Internet" at end of last line ljust
.PE
8<----------------------------------------------
Then, to get a PostScript file, do:
groff -Tps -p -ms lan.tr > lan.ps
and inspect it with 'gv lan.ps'.
In principle, you can also get an "ASCII art" version with
groff -Tascii -p -ms lan.tr > lan.txt
but for some reason the version of groff I'mm using (1.18.1)
is not producing the right results.
Hoping this helps. And can I attach the resulting PS file to
a mail to this list?
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 08-Mar-09 Time: 02:06:24
------------------------------ XFMail ------------------------------
More information about the linux-list
mailing list