Channel 9 Forums - Coffeehouse - Rich text source files.https://sec.ch9.ms/content/feedimage.pngChannel 9 Forums - Coffeehouse - Rich text source files.https://channel9.msdn.com/Forums
Channel 9 is a community. We bring forward the people behind our products and connect them with those who use them. We think there is a great future in software and we're excited about it. We want the community to participate in the ongoing conversation. This is the heart of Channel 9. We talk about our work but listen to the customer.https://channel9.msdn.com/Forums
enThu, 14 Dec 2017 02:44:50 GMTThu, 14 Dec 2017 02:44:50 GMTRev97-7-1Coffeehouse - Rich text source files.Why are we still stuck with using plain vanilla (albeit Unicode) text as source files?

What if I want to include tables in my comments, underline something, put something else in
bold or even highlight a paragraph and change the
color? Or maybe put an expainatory picture in there? Or a hyperlink? And while I'm at it - save the whole thing as XML instead of a text file?

Or maybe I can, I just don't know about it?

There has been much discussion over the years
about how to document code. And how to keep code
and documentation in sync. Javadoc and XML comments
are a step in the right direction. And nowadays
we've got syntax color coding to help us in our
daily work. I think it would rock if I didn't have to have one set of source files, and one set of Word-files for documenation.

Ofcourse there is a very real risk of vendor or format lock-in. But let's assume for a second that everyone gets along and uses XML, RTF or something when saving the files. Couldn't this be both convenient and increase productivity?
]]>https://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/1277#1277
Fri, 09 Apr 2004 01:45:31 GMThttps://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/1277#1277lars7https://channel9.msdn.com/Niners/lars/Discussions/RSSCoffeehouse - Rich text source files.I think this is a really good idea. I cant tell you how many times a picture would have been a much better comment than text alone could provide.

I dont think there is any reason to change the compilers though, you just need an IDE that will strip out the non-code stuff before it sends it to the compiler. Maybe someone (you?) should fork one of the open source C# IDE's and add this feature.]]>https://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/a5a9478fab04491c8c789dea0111bc90#a5a9478fab04491c8c789dea0111bc90
Fri, 09 Apr 2004 04:28:58 GMThttps://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/a5a9478fab04491c8c789dea0111bc90#a5a9478fab04491c8c789dea0111bc90Pseudo7https://channel9.msdn.com/Niners/Pseudo/Discussions/RSSCoffeehouse - Rich text source files.

lars wrote:

save the whole thing as XML instead of a text file?

Oh dear..]]>https://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/dfe8742780b1461dace59dea0111bcbe#dfe8742780b1461dace59dea0111bcbe
Fri, 09 Apr 2004 08:02:36 GMThttps://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/dfe8742780b1461dace59dea0111bcbe#dfe8742780b1461dace59dea0111bcbejj57https://channel9.msdn.com/Niners/jj5/Discussions/RSSCoffeehouse - Rich text source files.Yes! Here's a few thoughts I had on this a while ago
http://jdanielsmith.org/DML.

I like the CSS idea too. I could actually end the whole "best position of curly braces" war forever. And everyone is a winner.]]>https://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/9bd75025a1da40e6b6819dea0111bd5f#9bd75025a1da40e6b6819dea0111bd5f
Sat, 10 Apr 2004 11:08:54 GMThttps://channel9.msdn.com/Forums/Coffeehouse/1277-Rich-text-source-files/9bd75025a1da40e6b6819dea0111bd5f#9bd75025a1da40e6b6819dea0111bd5flars7https://channel9.msdn.com/Niners/lars/Discussions/RSSCoffeehouse - Rich text source files.I wrote something like this a few years back when I was using Eiffel. I needed a way of printing my code and I hacked together a syntax highlighter which read in its bits and pieces from an XML based definition file for the language and made it all pretty...

I worked out you only really need 2 rules for highlighting, which could be elaborated upon for positional info too

1st rule: Highlight key words. void, public etc.

2nd rule: Highlight between 2 identifiers. {}, "", /* */ etc.

There are times where languages dont use a symbolic closing identifier, so identifiers can also include a new line break (for example "//"), and a range till the end of a term, like a hexadecimal number (for example $ff3)

For each range define color and font style (with different styles for alpha and numerics). Inside each range you can also add lists of keywords for highlighting.

I found I could write highlighters for Eiffel, Delphi, C++, and Java using these simple rules.