From: Bryan Oakley on
On Jun 9, 12:37 am, Zhang Weiwu <zhangweiwu+J...(a)realss.com> wrote:
> In some part of the program I am writing I need to display a
> content-rich text by reading it from a file. By content-rich, I mean it
> have title level 1 to 3, uses oblique, bold style for some text. The
> original purpose is to display product description and welcome text, but
> later my user make much more use of this and display a lot other text,
> like, board of directors introduction.
>
> asciidoc would work well for my case, so does any lightweight markup
> language like bbcode. HTML is a bit too complicated because my "novice"
> users want to update it by themselves. So I think what I need is a
> rendering engine written in tcl for a lightweight markup language. Is
> there such a tool and how mature is it?

Try using the code on this page:

http://wiki.tcl.tk/22169

It lets you add tags based on regular expressions. For example, to
reformat a line that looks like "*Heading*" you would do something
like:

tag .t -regexp {\*.*\*$} 1.0 end {
%W delete "%s" ;# delete leading *
%W delete "%e -1c" ;# delete trailing *
%W tag add heading %s %e
}


It would be easy to support just about any simple markup you want.