embedding D in html: practical?

Stewart Gordon smjg_1998 at yahoo.com
Sat Feb 3 06:35:10 PST 2007


janderson Wrote:

<snip>
> By HTML control I mean one that allows you to edit like a word 
> doc.  It would be highly impractical to code in straight HTML 
> or XML.
</snip>

Like a word doc?  If you're writing source code, you want it to be more like editing a plain text file, don't you?  Unless you want to do the syntax highlighting manually.

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.

TextPad has a "Copy as HTML" feature, and it makes it easy to add syntax highlighting using CSS.  A few words of warning though:
- TextPad is a commercial product - though it is fully functional TBYB (its creators don't use the word "shareware"....)
- it isn't unicode conformant
- it doesn't support D's nested comments or WYSIWYG strings
- you'll have to manually add the <code> </code> tags afterwards
- you might have to switch off word wrap, particularly if you have it set to break lines on save

Stewart.



More information about the Digitalmars-d mailing list