Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 12 Nov 1997.
Re: HTML and ASCII [was: Re: THE NEW FAQ [....] ]

Re: HTML and ASCII [was: Re: THE NEW FAQ [....] ]

C. Martin (aa7...@cleveland.Freenet.Edu) wrote:

:    Your "that html code" reference is actually the key, I believe.
: Sure, <PRE> is nice, but try "<CODE>" instead, or in addition
: to.  Of course, I speak before I've tried this in reference
: to displaying ASCII art for say Lynx review, but whenever I
: think of <PRE>, I think of <CODE>, too.  Please let me know
: what you think on the matter. ;-)  Take Care and Blissed Be.

Well, <CODE> may not be the best choice for ascii art, as it is a text
level element used for displaying pieces of code.

 * It is intended as a semantic marker for code, not for ascii art.
 * Spaces are still collapsed inside it as normal.
 * Browsers are not required to render it monospaced - it is merely a
   convention.

<PRE>, on the other hand, stands for preformatted text, exactly what
ascii art is. If defined broadly enough, the terms are in fact
interchangeable. <PRE> is also the only non-deprecated HTML block level
element that instructs (note: even this isn't mandatory, as it may not
always be possible) the browser to render the contents monospaced.

As an example of semantically correct use of <PRE> and <CODE>, this
is adapted from beginner's guide to redcode:
(http://www.sci.fi/~iltzu/corewar/guide.html)

[snip]
<p>This is just what another classic warrior by Dewdney, the
<em>Dwarf</em>, does. It "bombs" the core at regularly spaced
locations with <code>DAT</code>s, while making sure it doesn't hit
itself.</p>

<pre>
        ADD #4, 3        ; execution begins here
        MOV 2, @2
        JMP -2
        DAT #0, #0
</pre>
[snip]

For ascii art, it'd use <PRE>, possibly with style sheets. If one really
needs in-line ascii art, the tag to use would be <TT>, which is a text
level style tag that instruct the browser to render the contents as
monospaced ("teletype") text, *but otherwise normally*, ie. you'd need
to use &nbsp; (non-breaking space, 0xA0, an ISO-8859-1 character) instead
of spaces for ascii art.

[snip]
<P>I can't see much use for &lt;TT&gt; in ascii art, except maybe for
one-liners like this rose: <tt>---'--<@</tt></p>
[snip]  

--  __,,,------._
 ,-/|            `-.  Ilmari Karonen (ilt...@sci.fi) ^ All opinions expressed
/,  '\,     `.  ,|"-;;.__ http://www.sci.fi/~iltzu/ | in this message are my
/ ' 4(_,-_,-"_,/.'   `'--' ,------------------------' own. If you want me to
"`-(_,-"" `-' (,' itz      | make some for you too, you should pay for them!

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f996b,f1f971752e3e320a
X-Google-Attributes: gidf996b,public
From: ilt...@sci.fi (Ilmari Karonen)
Subject: Re: HTML and ASCII [was: Re: THE NEW FAQ [....] ]
Date: 1997/11/12
Message-ID: <64d130$fi...@tron.sci.fi>#1/1
X-Deja-AN: 289218167
References: <01bceb06$5f8ae300$LocalHost@atkins> <641ud7$npr$2...@ci.ist.utl.pt> <64cbfh$7t...@alexander.INS.CWRU.Edu>
Distribution: inet
Organization: Very low
Newsgroups: alt.ascii-art
About this message. This message was posted publicly to the newsgroup alt.ascii-art in 1997 and is mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you the author? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post