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

ANNOUNCE: shtmlview 1.0.0

124 views
Skip to first unread message

D Groth

unread,
Mar 23, 2022, 2:37:57 AM3/23/22
to
shtmlview is a Tcl only snit megawidget to display HTML pages with support for most HTML 3.2 tags and Markdown files. It should be used for local HTML and Markdown files only for instance to display help pages within a Tk application. It does not support stylesheets, not web forms and not http(s) addresses. As it is a Tcl only extension it does not require any compilation. It is based on old code from Stephen Uhler, Clif Flynt and Robert Heller.

* Project page: hhttps://github.com/mittelmark/shtmlview
* Download: https://github.com/mittelmark/shtmlview/archive/refs/tags/v1.0.0.zip
* Manual: http://htmlpreview.github.io/?https://github.com/mittelmark/shtmlview/blob/master/shtmlview/shtmlview.html
* Wikipage: https://wiki.tcl-lang.org/page/shtmlview

Version 1.0.0 adds support for Markdown documents (using tcllibs Markdown library), base64 encoded inline images, support for jpeg (using img::jpeg) and svg images (using svgconvert or terminal applications rsvg-convert or cairosvg), support for the HTML 3.2 tags sub, sup, small, big, div (the latter can be used for styling). The rendering speed was as well improved, but obviously it is much slower than the binary counterparts tkhtml and tkhtml3. The project has now it's own Github page to allow tagging and real versioning.

Thanks to aplsimple and pepdiz for bug reports and suggestions. Without feedback - no progress!

D Groth

Gerry

unread,
Mar 29, 2022, 10:41:53 AM3/29/22
to
Your package looks interesting. One of these long spring evenings
I may look into it to see how hard it would be to have it use
entries in an SQLite database rather than files.


Gerry Snyder
--

Bezoar

unread,
Apr 12, 2022, 9:55:41 AM4/12/22
to
Yes if it supported loading from a buffer rather than just from a file that would be a good enhancement.

D Groth

unread,
Apr 22, 2022, 12:31:24 AM4/22/22
to
Dear Gerry and Bezoar,

In the current Github code I implemented your suggestion so that you can render directly HTML or Markdown strings.

The method is: `pathName render text ?ext?`

if html tags are present it will be rendered as HTML. If there are no tags at the beginning per default Markdown is assumed. The format can be enforced as well by providing the default file extension.

Have a look at the manual page. I am only in doubt currently how to handle links if there are no files ... I think there should be a user defined function to handle links to non-existing files. I'm open here for suggestions.

https://htmlpreview.github.io/?https://github.com/mittelmark/shtmlview/blob/master/shtmlview/shtmlview.html#section4

The current Git source code can be downloaded here:

https://downgit.github.io/#/home?url=https://github.com/mittelmark/shtmlview/tree/main/shtmlview

Please note that the script was reorganized together with akupries to allow inclusion into tklib. shtmlview is as well there in the current fossil trunk (slighly behind my github code).

Furthermore a plugin structure was added to allow rendering of other file formats which can be translated into HTML. As an example Tcl's doctools format was already added. So you can render now Tcl doctools manual pages like this: `tclsh shtmlview.tcl shtmlview.man`

Detlef
0 new messages