General XMetaL Discussion
LeeHart July 15, 2010 at 12:02 am
Feature Request: Syntax colorization in plan-text view.July 15, 2010 at 12:02 amParticipants 5Replies 6Last Activity 12 years, 2 months ago
XMetaL Versions: 4.0, 5.5, and 6.0
I've had requests for a better syntax colorization for plain text view. Our users prefer a mix of Tags On, Plain Text, and Normal views (in that order). Many other editors have a nice syntax colorization that persists when the contents are copied to the clipboard. This would be a valuable addition for us.
Examples of tools that do this include Visual Studio and Internet Explorer (View Source or raw XML view).
I don't know how many of your customers find value in the Plain Text view but we certainly do.
LeeDerek Read July 15, 2010 at 12:14 am
Reply to: Feature Request: Syntax colorization in plan-text view.July 15, 2010 at 12:14 am
So, it sounds like there are two issues:
1) Plain Text view syntax colouring not acceptable. Are there specifics that these users would like to see tweaked? There are currently no other requests to improve on what we already do. The colouring is fully customizable w.r.t. which colours are used (see: Tools > Options > Plain Text View). Perhaps they mean something else?
2) They are hoping we can put something on the clipboard other than plain text (the only thing we put there at the moment). Then another application that supports this other format would have the option to pull it down. Where are the users pasting to? I'm guessing Outlook maybe? If Outlook sees HTML on the clipboard it tries to preserve whatever it can when pasted into a message (depending on the format of the message — HTML, Plain Text or Rich Text). If that is the case then we'd probably need to generate some HTML with embedded styling in it and put that on the clipboard in addition to the plain text. This is not a feature we've been asked for before.LeeHart July 15, 2010 at 12:33 am
Reply to: Feature Request: Syntax colorization in plan-text view.July 15, 2010 at 12:33 am
It's different colors for element names, attribute names, attribute values, comments, markup (like '<' and '>') and plain text.
When it's on the clipboard, the Plain Text (1), Unicode Text (13), and OEM Text (7) are the unformatted text but the HTML Format and Rich Text Format versions include syntax colorization.
For those of us that regularly work with the plain text the syntax colorization is a great thing. I believe there are freely available XSLs to help with this. Notepad2 is an open source editor that displays syntax colorization for XML files (and many other files.) It doesn't have the clipboard support, but I'd rate that a smidge lower anyway.
I don't know if the Internet Explorer syntax colorization is programmatically exposed; if that would help you to support it in the next release I'll track that down.
LeeDerek Read July 15, 2010 at 12:41 am
Reply to: Feature Request: Syntax colorization in plan-text view.July 15, 2010 at 12:41 am
So for syntax colouring are you saying you don't see any when editing in XMetaL in Plain Text view? If so, that suggests there's an install issue as we have that feature (since probably about HoTMetaL 1.0 I assume, maybe even before that with Author Editor the precursor to HoTMetaL). See screen capture attached.
RE: Preserving colours on the clipboard.
I've just checked VS 2010 and it puts the data formats called “Text”, “Locale” and “Rich Text” on the clipboard when I copy text from an XML document. IE 7 puts those three plus “HTML” on the clipboard (those numbers you mention).
Details about standard dataformats here in case anyone is interested: http://msdn.microsoft.com/en-us/library/system.windows.dataformats.aspx
So, assuming Outlook is the target I suppose Rich Text must be the way that colouring is being preserved when pasting from VS. It may look for HTML first, then look for Rich Text, then finally one of the others (that's similar logic to what we use for our DITA paste from HTML / Word feature, we look for HTML and if we find it we transform to DITA, failing to find HTML we grab the Text, failing to find that we assume the format isn't one we can handle).
To be honest, this sounds like a nice to have feature, but there are quite a few “must haves” on our current road map. We also have other “nice to haves” obviously so this one would be fighting for dev time among those.
The more info about the intended usage you can give me the better so I can describe this to development in detail.Derek Read July 15, 2010 at 12:46 am
Reply to: Feature Request: Syntax colorization in plan-text view.July 15, 2010 at 12:46 am
I missed a few. XMetaL puts “Unicode Text”, “Locale”, “Text” and “OEM Text” on the clipboard.
I have a script that was checking this stuff and it is giving me different results from clipbrd.exeLeeHart July 15, 2010 at 1:28 am
Reply to: Feature Request: Syntax colorization in plan-text view.July 15, 2010 at 1:28 am
Yeah, there is syntax colorization displayed, I blame fried brain from looking at HomeSite and preparing for an overdue vacation. Yeah, colorization on paste is a nice to have, not a blocking feature.
However, I do regularly load files in IE so I can view source and then paste with syntax colorization.
LeeDerek Read July 16, 2010 at 11:26 pm
Reply to: Feature Request: Syntax colorization in plan-text view.July 16, 2010 at 11:26 pm
I've posted a demo of what I think you were asking for here:
No guarantees that this is really what you wanted or that it will work perfectly in your environment. I thought it was worth investigating what might be done in the short term though. If it doesn't quite work or doesn't quite do what you need I assume you can probably modify or extend it.
I wrote it to work with Outlook (only) as that was the quickest thing to try and it was fairly simple to figure out. Something similar could be coded for other products based on this idea, provided the other product supports HTML emails, and you can figure out how to get the HTML in there.
Ideally it might be nice to try to figure out how to just get this stuff on the clipboard. That would probably need some Windows Clipboard API work to be done (in C++ or other) and that is quite a bit beyond a demo. At that point I think we're looking at our dev team doing some programming work.
- You must be logged in to reply to this topic.