embedding D in html: practical?

janderson askme at me.com
Sat Feb 3 16:08:39 PST 2007


Stewart Gordon wrote:
> 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.

I'd imagine if you had a control that you could make into your own 
editor, syntax hightlighting would be automatic.  You could probably 
override it if necessary.

> > 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.

> 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

What's the point then?

> - 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
> 

I checked out TextPad.  It doesn't provide WYSIWYG strings, its not a 
control which I could fashion into my own editor (that provides context 
sensitivity ect..).  I might as well use scintilla (which is a control).

The main point of what I was taking about was WYSIWYG strings and images.

I've a feeling that the control I want just doesn't exist.

Thanks for your time.
> Stewart.



More information about the Digitalmars-d mailing list