• Strange behaviour of shtmlview

    From Helmut Giese@21:1/5 to All on Wed Jul 6 21:14:01 2022
    Hello out there,
    I want to use shtmlview for showing little help texts during a series
    of configuration screens. To get familiar with markdown I devised the
    script below to get immediate feedback as I ventured along learning
    markdown.
    To my surprise the shtmlview window remains empty whereas the
    generated HTML file looks ok and displays fine in my Firefox. The
    greatest surprise, however, happened when I had the empty text widget
    display its content: It showed all the text with the markdown
    'markers' removed (The '===' and the '###') and a nicely formatted
    list, too.
    How can this be? And what can I do about it?
    Any help or idea will be greatly appreciated.
    A slightly puzzled
    Helmut

    This is my Tcl file (mkdoc.tcl):
    ----
    package require mkdoc

    if {! [info exists hlp]} {
    package require shtmlview::shtmlview
    set hlp [shtmlview::shtmlview .hlp -toolbar 0]
    }

    proc mkdoc {in hlp} {
    set out [file rootname $in].html
    mkdoc::mkdoc $in $out
    $hlp browse $out
    }
    mkdoc [lindex $argv 0] $hlp
    puts "Content: '[$hlp helptext get 1.0 end]'"
    ----
    and this a sample file passed to it (sample.md):
    ----
    A sample for 'markdown'
    =======================

    This sample tries to understand markdown.

    ### Lists

    Markdown supports ordered (numbered) and unordered (bulleted) lists.
    Unordered lists use asterisks, pluses, and hyphens -- interchangably
    -- as list markers:

    * Red
    * Green
    * Blue
    ----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to greg on Thu Jul 7 08:38:06 2022
    greg schrieb am Donnerstag, 7. Juli 2022 um 17:17:51 UTC+2:
    Helmut Giese schrieb am Mittwoch, 6. Juli 2022 um 21:14:05 UTC+2:

    This is my Tcl file (mkdoc.tcl):
    package require mkdoc


    proc mkdoc {in hlp} {


    name of the tcl file (mkdoc.tcl) other than the proc. and package

    Gregor

    You did not pack the widget as far as I can see.

    BTW: Which version of shtmlview you are using? That from the github-repo https://github.com/mittelmark/shtmlview or that from tklib-repo?

    Detlef

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to Helmut Giese on Thu Jul 7 08:17:49 2022
    Helmut Giese schrieb am Mittwoch, 6. Juli 2022 um 21:14:05 UTC+2:

    This is my Tcl file (mkdoc.tcl):

    package require mkdoc


    proc mkdoc {in hlp} {


    name of the tcl file (mkdoc.tcl) other than the proc. and package

    Gregor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Giese@21:1/5 to D Groth on Thu Jul 7 21:52:01 2022
    D Groth <[email protected]> schrieb:

    You did not pack the widget as far as I can see.

    BTW: Which version of shtmlview you are using? That from the github-repo https://github.com/mittelmark/shtmlview or that from tklib-repo?

    Detlef
    Hi Detlef,
    this was it in fact. Once I packed it it showed up in all its glory.
    What a stupid mistake.
    Many thanks for spotting it - and for this package, too.
    From where did I get it? I don't know. I remembered a thread here in
    clt several months ago, found it and then somehow got it. It has a
    file size of 146.329 and says
    package provide shtmlview::shtmlview 1.1.0

    Thanks again and best regards
    Helmut
    PS: Checking the github address you gave above I found that I have
    exact this version:

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to D Groth on Thu Jul 7 21:50:07 2022
    PS: You can as well render and edit directly Markdown files, just running the shtmlview.tcl file directly from the terminal:
    `tclsh shtmlview.tcl sample.md` In Tklib the application is separated from the widget, `shtmlview sample.md` should do the trick then.

    D Groth schrieb am Freitag, 8. Juli 2022 um 06:37:29 UTC+2:
    Sometimes we loose so much time on the easy, stupid errors ...
    BTW: In the later versions you can toggle between view and edit mode using Ctrl-Shift-e (Ctrl-E) for editing and Ctrl-s for saving, Ctrl-r for reloading, see the manual page. The editor is just a simple text widget but sufficient for small changes.
    The widget will be part of the next Tklib release.
    Detlef
    Helmut Giese schrieb am Donnerstag, 7. Juli 2022 um 21:52:05 UTC+2:
    D Groth <[email protected]> schrieb:
    You did not pack the widget as far as I can see.

    BTW: Which version of shtmlview you are using? That from the github-repo https://github.com/mittelmark/shtmlview or that from tklib-repo?

    Detlef
    Hi Detlef,
    this was it in fact. Once I packed it it showed up in all its glory.
    What a stupid mistake.
    Many thanks for spotting it - and for this package, too.
    From where did I get it? I don't know. I remembered a thread here in
    clt several months ago, found it and then somehow got it. It has a
    file size of 146.329 and says
    package provide shtmlview::shtmlview 1.1.0

    Thanks again and best regards
    Helmut
    PS: Checking the github address you gave above I found that I have
    exact this version:

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to Helmut Giese on Thu Jul 7 21:37:26 2022
    Sometimes we loose so much time on the easy, stupid errors ...
    BTW: In the later versions you can toggle between view and edit mode using Ctrl-Shift-e (Ctrl-E) for editing and Ctrl-s for saving, Ctrl-r for reloading, see the manual page. The editor is just a simple text widget but sufficient for small changes.
    The widget will be part of the next Tklib release.
    Detlef

    Helmut Giese schrieb am Donnerstag, 7. Juli 2022 um 21:52:05 UTC+2:
    D Groth <[email protected]> schrieb:
    You did not pack the widget as far as I can see.

    BTW: Which version of shtmlview you are using? That from the github-repo https://github.com/mittelmark/shtmlview or that from tklib-repo?

    Detlef
    Hi Detlef,
    this was it in fact. Once I packed it it showed up in all its glory.
    What a stupid mistake.
    Many thanks for spotting it - and for this package, too.
    From where did I get it? I don't know. I remembered a thread here in
    clt several months ago, found it and then somehow got it. It has a
    file size of 146.329 and says
    package provide shtmlview::shtmlview 1.1.0

    Thanks again and best regards
    Helmut
    PS: Checking the github address you gave above I found that I have
    exact this version:

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)