Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

is there a lightweight markup language rendering engine using text widget

20 views
Skip to first unread message

Zhang Weiwu

unread,
Jun 9, 2010, 1:37:06 AM6/9/10
to
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?

Thanks in advance!

P.S. My homework including reading this article which didn't give any
read-to-use products or tools but only mostly ideas, or code that was
said to be done but not published:

A wiki-like markup language for the text widget
<http://wiki.tcl.tk/_/ref?N=3084>

Also I checked syntax highlight library offered by tkoutline but found
two problems.

1. it doesn't work on tk8.5 (is okay with tk8.4), while my exiting
application made too much use of tcl/k8.5
2. It take some work to customize the library to display headline
etc, and not sure in case *bold* can it hide the asterisk when
making "bold" bold

However it has the potential to be improved to an asciidoc rendering
engine, out side of my project's time scope though.

Another homework I did is to check lightweight markup language comparison
http://en.wikipedia.org/wiki/Lightweight_markup_language
only to find none are supported by tcl.

I checked there exist a basic HTML rendering engine: scrolledhtml
<http://wiki.tcl.tk/_/ref?N=2306> and htext
<http://wiki.tcl.tk/_/ref?N=1848>

Arndt Roger Schneider

unread,
Jun 9, 2010, 5:30:53 AM6/9/10
to
Zhang Weiwu schrieb:

Your conclusion seems correct so-far.

+ The gridplus package appears to have some htmlish markup, too
http://www.satisoft.com/tcltk/gridplus/text.html


+ Jeszra's code generation could also being extended to handle
asciidoc import, but than the text-code generation is trivial --it
hardly warrants the effort...

Are you planning to use asciidoc as the front-end for a docbook toolchain?


-roger

Bryan Oakley

unread,
Jun 9, 2010, 6:20:31 PM6/9/10
to
On Jun 9, 12:37 am, Zhang Weiwu <zhangweiwu+J...@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.

0 new messages