HighDots Forums  

Formatting code/scripts/configuration files rendered on a website

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Formatting code/scripts/configuration files rendered on a website in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hendrik Maryns
 
Posts: n/a

Default Formatting code/scripts/configuration files rendered on a website - 06-18-2008 , 08:44 AM






Hi,

Since I was so pleased to discover how to enable my keyboard to type
symbols like … directly, I made a howto-page about it:
http://tcl.sfs.uni-tuebingen.de/~hendrik/keyboard.shtml.

I tried to follow the advice from
http://xhtml.com/en/xhtml/reference/pre/ to not use the <pre> tag, but I
am not satisfied with it, since tabs are not preserved (see bottom
part). This is not essential here, but would be nice. Can I do that
with an addition to the CSS given on the link above? (I removed #
margin: 1px 0; since I don’t like it.)

H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html

Reply With Quote
  #2  
Old   
Hendrik Maryns
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-18-2008 , 08:53 AM






Hendrik Maryns schreef:
Quote:
Hi,

Since I was so pleased to discover how to enable my keyboard to type
symbols like … directly, I made a howto-page about it:
http://tcl.sfs.uni-tuebingen.de/~hendrik/keyboard.shtml.

I tried to follow the advice from
http://xhtml.com/en/xhtml/reference/pre/ to not use the <pre> tag, but I
am not satisfied with it, since tabs are not preserved (see bottom
part). This is not essential here, but would be nice. Can I do that
with an addition to the CSS given on the link above? (I removed #
margin: 1px 0; since I don’t like it.)
Ok, found it already, simply add

white-space: pre;

to ol.code-unnumbered li (note: *not* to ol.code-unnumbered).

H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


Reply With Quote
  #3  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-18-2008 , 12:00 PM



Scripsit Hendrik Maryns:

Quote:
I tried to follow the advice from
http://xhtml.com/en/xhtml/reference/pre/ to not use the <pre> tag,
Why? Their page looks reasonable (at least when viewed text-only, the
usual bogosity check), and they have a superficially good argument
(<pre> carries no meaning), but what _is_ this xhtml.com? The only
information I found easily is an obfuscated E-mail address:
"For comments about xhtml.com, please contact: feedback [at] xhtml.com"

This gives an initial expectation of credibility around -100.

The argument isn't really that good. What do you use instead? If you
have data where whitespace really matters, like Python code, then why
would you _rely_ on CSS as regards to getting this important _content_
information delivered?

The usual CSS Caveats imply that <pre>, rather than any CSS constructs,
are the right way to go if the data _is_ really preformatted plain text
and preserving that is essential.

Quote:
but I am not satisfied with it, since tabs are not preserved
By HTML specifications, tab stops should appear in a certain way _and_
authors should not rely on this. Use the safe way: spaces.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #4  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-18-2008 , 12:43 PM



Jukka K. Korpela wrote:
Quote:
Scripsit Hendrik Maryns:

I tried to follow the advice from
http://xhtml.com/en/xhtml/reference/pre/ to not use the <pre> tag,

Why? Their page looks reasonable (at least when viewed text-only, the
usual bogosity check), and they have a superficially good argument
(<pre> carries no meaning), but what _is_ this xhtml.com? The only
information I found easily is an obfuscated E-mail address:
"For comments about xhtml.com, please contact: feedback [at] xhtml.com"

This gives an initial expectation of credibility around -100.
There are no limits to the irrelevance of the factors on which you base
your credibility assessments, are there? Their credibility on the value
of the PRE tag can be judged by your personal feelings about munged
e-mail addresses? That's like saying that the initial expectation of
credibility of the remainder of your response (which is a great
treatment) is -100% because of your bogus invocation of their approach
to contact information.


Reply With Quote
  #5  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-18-2008 , 03:19 PM



Scripsit Harlan Messinger:

Quote:
Their credibility on
the value of the PRE tag can be judged by your personal feelings
about munged e-mail addresses?
No, their _general_ credibility gets a low initial score due to the
_fact_ that they don't even tell who they are (and don't even tell their
names and real e-mail address).

Quote:
That's like saying that the initial
expectation of credibility of the remainder of your response (which
is a great treatment) is -100% because of your bogus invocation of
their approach to contact information.
That's like your usual babbling about irrelevant things. I think you
could do better. You might have, for example, made a _single_ reasonable
or reasonable-looking comment on the on-topic issue whether <pre> should
really be avoided in favor of CSS (or even on the remotely-on-topic
issue whether xhtml.com should be relied on).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #6  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-18-2008 , 04:12 PM



Jukka K. Korpela wrote:
Quote:
Scripsit Harlan Messinger:

Their credibility on
the value of the PRE tag can be judged by your personal feelings
about munged e-mail addresses?

No, their _general_ credibility gets a low initial score due to the
_fact_ that they don't even tell who they are (and don't even tell their
names and real e-mail address).
?? Most products you buy in the store carry neither the name of the
owner or CEO of either the manufacturer or the store. Why does a website
have to carry the name of its owner?

Quote:
That's like saying that the initial
expectation of credibility of the remainder of your response (which
is a great treatment) is -100% because of your bogus invocation of
their approach to contact information.

That's like your usual babbling about irrelevant things.
Gee, responding when I call you on your appeal to irrelevant factors by
pretending it's irrelevant. Did you think of that all by yourself?

Quote:
I think you
could do better. You might have, for example, made a _single_ reasonable
or reasonable-looking comment on the on-topic issue whether <pre> should
really be avoided in favor of CSS (or even on the remotely-on-topic
issue whether xhtml.com should be relied on).
Nice job of hand-waving.


Reply With Quote
  #7  
Old   
Stanimir Stamenkov
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-19-2008 , 01:29 AM



Wed, 18 Jun 2008 14:44:14 +0200, /Hendrik Maryns/:

Quote:
I tried to follow the advice from
http://xhtml.com/en/xhtml/reference/pre/ to not use the <pre> tag,
If the only reason not use <pre> is it "has no semantic meaning" you
could give it meaning, like:

<pre><code>...</code></pre>

At least I use the above often and there's a <blockcode> [1] element
in the XHTML 2 draft which I mimic using that markup. Depending on
the content you could use also:

<pre><samp>...</samp></pre>

I guess one could come up with more examples. I tend to think of
<pre> as paragraph or generic block (<div>), interchangeably, which
has some predefined styling.

[1]
http://www.w3.org/TR/xhtml2/mod-structural.html#edef_structural_blockcode

--
Stanimir


Reply With Quote
  #8  
Old   
Andy Dingley
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-19-2008 , 06:49 AM



On 18 Jun, 20:19, "Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote:

Quote:
No, their _general_ credibility gets a low initial score due to the
_fact_ that they don't even tell who they are (and don't even tell their
names and real e-mail address).
The problem with that logic is that it describes Richard Bullis as
credible,
because his self-evident stupidity is such a strong authentication of
his identity.


Reply With Quote
  #9  
Old   
Hendrik Maryns
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-19-2008 , 07:14 AM



Jukka K. Korpela schreef:
Quote:
Scripsit Hendrik Maryns:

I tried to follow the advice from
http://xhtml.com/en/xhtml/reference/pre/ to not use the <pre> tag,

Why? Their page looks reasonable (at least when viewed text-only, the
usual bogosity check), and they have a superficially good argument
(<pre> carries no meaning), but what _is_ this xhtml.com? The only
information I found easily is an obfuscated E-mail address:
"For comments about xhtml.com, please contact: feedback [at] xhtml.com"

This gives an initial expectation of credibility around -100.
Notwithstanding your objections, I found the site very helpful,
containing nice suggestions to format <code> and <kbd>.

Quote:
The argument isn't really that good. What do you use instead? If you
have data where whitespace really matters, like Python code, then why
would you _rely_ on CSS as regards to getting this important _content_
information delivered?

The usual CSS Caveats imply that <pre>, rather than any CSS constructs,
are the right way to go if the data _is_ really preformatted plain text
and preserving that is essential.

but I am not satisfied with it, since tabs are not preserved

By HTML specifications, tab stops should appear in a certain way _and_
authors should not rely on this. Use the safe way: spaces.
Can you explain this further? I do not want to use spaces there since
that’s not what I use in the original file as well. Tabs are meant for
aligning, right, well, that’s just what I want to happen there.

I could wrap the whole thing in a table, right, but that would make it
more work than it’s worth.

Cheers, H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


Reply With Quote
  #10  
Old   
Hendrik Maryns
 
Posts: n/a

Default Re: Formatting code/scripts/configuration files rendered on a website - 06-19-2008 , 07:23 AM



Stanimir Stamenkov schreef:
Quote:
Wed, 18 Jun 2008 14:44:14 +0200, /Hendrik Maryns/:

I tried to follow the advice from
http://xhtml.com/en/xhtml/reference/pre/ to not use the <pre> tag,

If the only reason not use <pre> is it "has no semantic meaning" you
could give it meaning, like:

pre><code>...</code></pre
Hm, but what with the example from the site I gave? It is not really
code, but rather some configuration information in a file.

Quote:
pre><samp>...</samp></pre
This seems more appropriate, but maybe just <pre> seems the right way to
go, really, as Jukka suggested.

H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.