По-русски Notes

Thursday, June 24, 2004

Formatting

The task is to apply colors, fonts, and layout attributes to blocks of text accoring to some patterns. It's common practice to write text patterns in form of regular expressions. Thus we could define style for document as a set of pairs of a regular expression and formatting description.

The task is to apply colors, fonts, and layout attributes to blocks of text accoring to some patterns. It's common practice to write text patterns in form of regular expressions. Thus we could define style for document as a set of pairs of a regular expression and formatting description.

But C# code is structured text. There is a working solution of structured text formatting, that is XML with style sheets. While C# code is not XML, editor could treat the code as XML internally and apply style sheets, and then render the result on screen. Equivalent XML could look like this

<comment>An example of class</comment>
<class>
<keyword>public</keyword>
<keyword>class</keyword> Class1
{
<method>
<keyword>public</keyword>
<keyword>static</keyword>
<MethodName>Main</MethodName>()
{
<MethodBody>
Console.WriteLine("Hello World");
</MethodBody>
} </method>
} </class>

CSS can use regular expressions as well, thus providing possibility of using regular expressions only to describe formatting rules.

Options dialog present in IDE could provide a limited set of funstionality to simplify the process of formatting. Advanced users can type their own style sheets or create them with third party tools.

2 Comments:

At 11/01/2005 5:00 AM, Blogger usb cable nokia 322023e said...

Irresistible blog. I look for blogs like this one
when time allows me to. I enjoyed the site and I'll
check it next time!
I beg of you, just check out my advance cash on line blog.

 
At 11/22/2005 4:25 AM, Blogger job opportunitya said...

Inspiring blog. I love finding blogs this good on
the internet, when I have the time. I'm going to go
back to it!
It may look like it was hard work, but my hollywood plastic surgery blog was simple.

 

Post a Comment

<< Home