> I am thankful for any tip, but my question was not about how I should go
> about implementing the highlighting in PHP. My question is what would be
> the best possible markup in the result, semantically speaking.
>
> ...
>
> The makers of HTML did some groundwork. They gave us the tags <var>,
> <code>, <samp> and <tt>. Now I want to see if there is any idea to
> perhaps introduce a microformat to produce more specific semantic code.
Well ... semantic is rather useless if you don't have a receiver
understanding it. Your receiver is an alien browser (you're not defining
it's semantic capabilities), so anyway whatever you do it ends up with
it's semantic base, not yours.
And the few tags you've got are quiet not enough to give appropriate
semantics to a programming language (depends ...). I would not try to
shift the interpretation to the browser. If you can serve the correct
doc-type/content-type you could try as you mention:
<style type="text/css">
block:before {
content: '{\n';
}
block:after{
content: '}\n';
}
decl[type="class"]:before {
content: 'class ';
}
decl[type="var"]:before {
content: 'var ';
}
</style>
<code type="php">
<decl type="class">test</decl>
<block>
<decl type="var">$attribute</decl>
...
</block>
</code>
But, I wouldn't really try that, giving sensefull semantics to a
programming language is, well, like rewriting the PHP-interpreter
or the gcc untill RTL-code.
Probably other would even disagree on what's suppose to be semantic
in the context of a programming language.
So, let it go, work with span+classes.
> Lars Gunther
Ciao
Niels
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************