Main Page | Report Page

 

  Computers Forum Index » Computer Languages (TCL) » html prettifier/beautifier for tcl...

Author Message
Tcl Bliss...
Posted: Tue Oct 19, 2010 7:40 pm
 
Does anyone know of a good html prettifier/beautifier for tcl source
code, similar to http://code.google.com/p/google-code-prettify/ ?
Perhaps one can be created for the above Google project?
 
Tcl Bliss...
Posted: Tue Oct 19, 2010 11:38 pm
 
On Oct 19, 2:42 pm, Arndt Roger Schneider <arndt.ro... at (no spam) addcom.de>
wrote:
Quote:
Tcl Bliss schrieb:

Does anyone know of a good html prettifier/beautifier for tcl source
code, similar tohttp://code.google.com/p/google-code-prettify/?
Perhaps one can be created for the above Google project?

Try Vim html export.
-roger

Actually, what I am looking for command that does it inline, real
time, something that can be used in a script or inside a web page. TCL
package would be the best, or Javascript.

I thought of doing it myself but haven't figured out how to do it yet.
I would guess that it needs to work pretty much the way TCL parser
works, which is something I still need to learn.
 
Arndt Roger Schneider...
Posted: Wed Oct 20, 2010 1:42 am
 
Tcl Bliss schrieb:
Quote:
Does anyone know of a good html prettifier/beautifier for tcl source
code, similar to http://code.google.com/p/google-code-prettify/ ?
Perhaps one can be created for the above Google project?

Try Vim html export.
-roger
 
Harald Oehlmann...
Posted: Wed Oct 20, 2010 6:47 am
 
On 20 Okt., 01:38, Tcl Bliss <tcl.bl... at (no spam) gmail.com> wrote:
Quote:
On Oct 19, 2:42 pm, Arndt Roger Schneider <arndt.ro... at (no spam) addcom.de
wrote:
Tcl Bliss schrieb:
Does anyone know of a good html prettifier/beautifier for tcl source
code, similar tohttp://code.google.com/p/google-code-prettify/?
Perhaps one can be created for the above Google project?

Actually, what I am looking for command that does it inline, real
time, something that can be used in a script or inside a web page. TCL
package would be the best, or Javascript.

As I understood your initial post, you want to pretty-print TCL Code
and have output in HTML ?

- JavaScript Module: the Google prettifier you mentioned gives
instructions how to extent this for other languages, might be easy for
TCL...

- TCL Module: Jos Decoster has extended the TCL wiki by a TCL code
beautifier with HTML output.
The code must be available somewhere. If you have issues, contact Jos.

Harald
 
Arndt Roger Schneider...
Posted: Wed Oct 20, 2010 12:07 pm
 
Tcl Bliss schrieb:
Quote:
On Oct 19, 2:42 pm, Arndt Roger Schneider <arndt.ro... at (no spam) addcom.de
wrote:

Tcl Bliss schrieb:


Does anyone know of a good html prettifier/beautifier for tcl source
code, similar tohttp://code.google.com/p/google-code-prettify/?
Perhaps one can be created for the above Google project?

Try Vim html export.
-roger


Actually, what I am looking for command that does it inline, real
time, something that can be used in a script or inside a web page. TCL
package would be the best, or Javascript.

I thought of doing it myself but haven't figured out how to do it yet.
I would guess that it needs to work pretty much the way TCL parser
works, which is something I still need to learn.

The DocBook toolchain contains syntax highlighting for
Tcl: search for xslthl; as the name suggests it works
as a XSL-transformation coupled with sax.
Xslthl uses a two-pass transformation: first the relevant
codeblocks are instrumented with xslthl identifiers,
like xslthl:string, and second the xslthl identifiers are
replaced by html/css code.

For code samples see my Jeszra website:
http://jeszra/sourceforge,net/jeszra

-roger
 
phil...
Posted: Wed Oct 20, 2010 2:40 pm
 
On Oct 19, 2:40 pm, Tcl Bliss <tcl.bl... at (no spam) gmail.com> wrote:
Quote:
Does anyone know of a good html prettifier/beautifier for tcl source
code, similar tohttp://code.google.com/p/google-code-prettify/?
Perhaps one can be created for the above Google project?

Its not pretty in the sense of color coding...

but the tdom package will read in a messy html file without newlines,
and spit back out a prettier version.

package require tdom
...
set x [dom parse -html $a]
puts [$x asXML]
 
tomk...
Posted: Wed Oct 20, 2010 5:06 pm
 
On Oct 19, 12:40 pm, Tcl Bliss <tcl.bl... at (no spam) gmail.com> wrote:
Quote:
Does anyone know of a good html prettifier/beautifier for tcl source
code, similar tohttp://code.google.com/p/google-code-prettify/?
Perhaps one can be created for the above Google project?

FYI, I believe the Tcl'er Wiki uses an extended version of the google-
code-prettify code to prettify tcl code.

Tom K.
 
Glenn Jackman...
Posted: Wed Oct 20, 2010 6:07 pm
 
At 2010-10-19 07:38PM, "Tcl Bliss" wrote:
Quote:
On Oct 19, 2:42 pm, Arndt Roger Schneider <arndt.ro... at (no spam) addcom.de> wrote:
Tcl Bliss schrieb:

Does anyone know of a good html prettifier/beautifier for tcl source
code, similar tohttp://code.google.com/p/google-code-prettify/?
Perhaps one can be created for the above Google project?

Try Vim html export.

Actually, what I am looking for command that does it inline, real
time, something that can be used in a script or inside a web page. TCL
package would be the best, or Javascript.

This Tcl command

exec vim -c "runtime syntax/html.vim" -c w -c qa file.tcl

creates file.tcl.html

--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous
 
Glenn Jackman...
Posted: Wed Oct 20, 2010 6:15 pm
 
At 2010-10-19 07:38PM, "Tcl Bliss" wrote:
Quote:
On Oct 19, 2:42 pm, Arndt Roger Schneider <arndt.ro... at (no spam) addcom.de> wrote:
Tcl Bliss schrieb:

Does anyone know of a good html prettifier/beautifier for tcl source
code, similar tohttp://code.google.com/p/google-code-prettify/?
Perhaps one can be created for the above Google project?

Try Vim html export.

Actually, what I am looking for command that does it inline, real
time, something that can be used in a script or inside a web page. TCL
package would be the best, or Javascript.

This Tcl command
exec vim -c "runtime syntax/html.vim" -c w -c qa file.tcl
creates file.tcl.html

I have an alias in myh .bashrc
alias beautify_tcl='frink -egINnz -w 150'
Can't remember the last time I used it though. http://wiki.tcl.tk/2611

--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous
 
Tcl Bliss...
Posted: Thu Oct 21, 2010 4:30 pm
 
Thanks everyone for the links/tips. I will pick one that works the
best or use one as an example to code my own. Looking at examples I
noticed that there isn't much intelligence involved (the way TCL
parser works), you just get a list of keywords/operands/functions/
variables, regexp for each and add highlighting code. I expected it to
be more complicated than that.
 
Johannes Kuhn...
Posted: Thu Oct 21, 2010 7:46 pm
 
http://nagelfar.berlios.de/ can do this. (use the html output option)


Tcl Bliss wrote:
Quote:
Thanks everyone for the links/tips. I will pick one that works the
best or use one as an example to code my own. Looking at examples I
noticed that there isn't much intelligence involved (the way TCL
parser works), you just get a list of keywords/operands/functions/
variables, regexp for each and add highlighting code. I expected it to
be more complicated than that.

 
 
Page 1 of 1    
All times are GMT
The time now is Thu Jul 24, 2014 3:59 am