embedding D in html: practical?
Thomas Kuehne
thomas-dloop at kuehne.cn
Sat Feb 3 17:15:12 PST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
janderson schrieb am 2007-02-04:
> Stewart Gordon wrote:
>> janderson Wrote:
>> > Writing the code, and then doing a search and replace to convert '&',
>> > '<' and '>' to their HTML equivalents doesn't strike me as impractical.
>> > Only when you want to do syntax highlighting does hand-coding begin to
>> > be cumbersome IMO. And even then, I can see some text editors having
>> > enough regexp power to lighten the load.
>>
> When you've got HTML to worry about (particularly with syntax
> highlighting) its yet area for potential syntax bugs. You've also got
> more syntax to read and debug. The whole point is readability, I'm
> never going to look at code in html viewer, so why have all the ugly '<'
> and '>' and use my imagination to see the pictures and lines are.
For nice source code use the XHTML template below:
1 : <?xml version="1.0" encoding="utf-8"?>
2 : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 : "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 : <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
5 : <head><title>XHTML Example</title></head>
6 : <body><pre><code><![CDATA[
7 : if(x < 0 || "<a>b" != y) ....
8 : ]]></code></pre></body>
9 : </html>
Some browsers require the file ending "xhtml" instead of "html".
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFxUALLK5blCcjpWoRAhH2AJ4yN8oSlGUuZHbsmKw5O/h60ZgOUgCeMQmM
FfCyZakoJZXT5gT+Fj3hzVI=
=P86C
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list