• ANNOUNCE: shtmlview 0.9.3

    From D Groth@21:1/5 to All on Thu Mar 10 04:05:26 2022
    shtmlview is pur Tcl only snit megawidget to display a large subset of HTML. It should be used for local HTML files only for instance to display help pages within a Tk application. It does not support stylesheets 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/DGTcl
    * Download: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview
    * Manual: http://htmlpreview.github.io/?https://github.com/mittelmark/DGTcl/blob/master/lib/shtmlview/shtmlview.html
    * Wikipage: https://wiki.tcl-lang.org/page/shtmlview

    Version 0.9.3 adds support for mouse-wheel scrolling and contains bug-fixes for text copy and http(s) links and anchor links (thanks to aplsimple).

    D Groth

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave@21:1/5 to D Groth on Thu Mar 10 11:29:02 2022
    On 3/10/2022 6:05 AM, D Groth wrote:
    shtmlview is pur Tcl only snit megawidget to display a large subset of HTML. It should be used for local HTML files only for instance to display help pages within a Tk application. It does not support stylesheets 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/DGTcl
    * Download: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview
    * Manual: http://htmlpreview.github.io/?https://github.com/mittelmark/DGTcl/blob/master/lib/shtmlview/shtmlview.html
    * Wikipage: https://wiki.tcl-lang.org/page/shtmlview

    Version 0.9.3 adds support for mouse-wheel scrolling and contains bug-fixes for text copy and http(s) links and anchor links (thanks to aplsimple).


    Sounded interesting so I gave the example from the manpage a try. Maybe
    my snit package (2.3.2 from tcllib 1.19) is too old?

    % ::shtmlview::shtmlview .help -toolbar true -browsecmd browsed
    Error in constructor: bad window path name ".help.toolbar"
    % set errorInfo
    bad window path name ".help.toolbar"
    while executing
    "pack $win.toolbar -side top -fill x -expand false"
    (procedure "::shtmlview::shtmlview::Snit_methodconfigureToolbar"
    line 10)
    invoked from within
    ".help configureToolbar -toolbar true"
    ("uplevel" body line 1)
    invoked from within
    "uplevel 1 $command"
    (procedure "::snit::RT.method.configurelist" line 37)
    invoked from within
    "$self configurelist $args"
    (procedure "::shtmlview::shtmlview::Snit_constructor" line 10)
    invoked from within
    "::shtmlview::shtmlview::Snit_constructor ::shtmlview::shtmlview ::shtmlview::shtmlview::Snit_inst2 .help .help -toolbar true -browsecmd browsed"
    ("eval" body line 1)
    invoked from within
    "eval [linsert $arglist 0 ${type}::Snit_constructor $type $selfns
    $instance $instance]"
    (procedure "RT.ConstructInstance" line 9)
    invoked from within
    "RT.ConstructInstance $type $selfns $name $args"
    (procedure "::snit::RT.widget.typemethod.create" line 62)
    invoked from within
    "::shtmlview::shtmlview .help -toolbar true -browsecmd browsed"
    ("uplevel" body line 1)
    invoked from within
    "uplevel #0 {::shtmlview::shtmlview .help -toolbar true -browsecmd
    browsed}"

    --
    computerjock AT mail DOT com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to Dave on Thu Mar 10 10:12:37 2022
    Thanks for the report, I think I fixed the issue. The snit version should be modern enough.

    Here again the download link: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview

    DG
    Dave schrieb am Donnerstag, 10. März 2022 um 18:29:11 UTC+1:
    On 3/10/2022 6:05 AM, D Groth wrote:
    shtmlview is pur Tcl only snit megawidget to display a large subset of HTML. It should be used for local HTML files only for instance to display help pages within a Tk application. It does not support stylesheets 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/DGTcl
    * Download: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview
    * Manual: http://htmlpreview.github.io/?https://github.com/mittelmark/DGTcl/blob/master/lib/shtmlview/shtmlview.html
    * Wikipage: https://wiki.tcl-lang.org/page/shtmlview

    Version 0.9.3 adds support for mouse-wheel scrolling and contains bug-fixes for text copy and http(s) links and anchor links (thanks to aplsimple).

    Sounded interesting so I gave the example from the manpage a try. Maybe
    my snit package (2.3.2 from tcllib 1.19) is too old?

    % ::shtmlview::shtmlview .help -toolbar true -browsecmd browsed
    Error in constructor: bad window path name ".help.toolbar"
    % set errorInfo
    bad window path name ".help.toolbar"
    while executing
    "pack $win.toolbar -side top -fill x -expand false"
    (procedure "::shtmlview::shtmlview::Snit_methodconfigureToolbar"
    line 10)
    invoked from within
    ".help configureToolbar -toolbar true"
    ("uplevel" body line 1)
    invoked from within
    "uplevel 1 $command"
    (procedure "::snit::RT.method.configurelist" line 37)
    invoked from within
    "$self configurelist $args"
    (procedure "::shtmlview::shtmlview::Snit_constructor" line 10)
    invoked from within
    "::shtmlview::shtmlview::Snit_constructor ::shtmlview::shtmlview ::shtmlview::shtmlview::Snit_inst2 .help .help -toolbar true -browsecmd browsed"
    ("eval" body line 1)
    invoked from within
    "eval [linsert $arglist 0 ${type}::Snit_constructor $type $selfns
    $instance $instance]"
    (procedure "RT.ConstructInstance" line 9)
    invoked from within
    "RT.ConstructInstance $type $selfns $name $args"
    (procedure "::snit::RT.widget.typemethod.create" line 62)
    invoked from within
    "::shtmlview::shtmlview .help -toolbar true -browsecmd browsed"
    ("uplevel" body line 1)
    invoked from within
    "uplevel #0 {::shtmlview::shtmlview .help -toolbar true -browsecmd
    browsed}"

    --
    computerjock AT mail DOT com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave@21:1/5 to D Groth on Thu Mar 10 15:42:13 2022
    On 3/10/2022 12:12 PM, D Groth wrote:
    Thanks for the report, I think I fixed the issue. The snit version should be modern enough.

    Here again the download link: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview


    Thanks, that worked. The package looks like a helpful addition for
    displaying help docs. I'll continue experimenting.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From pd@21:1/5 to All on Thu Mar 10 14:15:59 2022
    El jueves, 10 de marzo de 2022 a las 13:05:30 UTC+1, D Groth escribió:
    shtmlview is pur Tcl only snit megawidget to display a large subset of HTML. It should be used for local HTML files only for instance to display help pages within a Tk application.
    Version 0.9.3 adds support for mouse-wheel scrolling and contains bug-fixes for text copy and http(s) links and anchor links (thanks to aplsimple).

    When opening files with browse command it doesn't keep the file path unless you provide it, so if you provide only a name for a file in current directory when you change directory shtmlview is not able to reopen the file, this happen when moving back and
    forward with several files opened. I think it would be better if you get the realpath of the file and always save the full path to the file to reload it.

    Also back and forward buttons only works with files but not with anchors inside a file.

    I don't know if those two characteristics are features or bugs, so I just report them for you knowledge and decide what to do (I feel more comfortable working as I expect, but it's just me)

    Anyway I find the megawidget pretty interesting and very usefull for documentation or guides. Thanks for your work.

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to All on Fri Mar 11 01:41:36 2022
    Thanks for the reports. I now added as well support for backward and forward with internal anchors, and I used file normalize to store the complete file path. Not sure if this solves your change directory problem. It should ...

    Here again the download link: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview

    I hope this works. Please note that is very old code from a few famous Tcl coders (Uhler 1995, Flint 1999-2000, Heller 2002-2008 around) which I just merged together into this megawidget to make it usable for a broader community, so fixing and extending
    is not that easy ;)

    D Groth

    pd schrieb am Donnerstag, 10. März 2022 um 23:16:03 UTC+1:
    El jueves, 10 de marzo de 2022 a las 13:05:30 UTC+1, D Groth escribió:
    shtmlview is pur Tcl only snit megawidget to display a large subset of HTML. It should be used for local HTML files only for instance to display help pages within a Tk application.
    Version 0.9.3 adds support for mouse-wheel scrolling and contains bug-fixes for text copy and http(s) links and anchor links (thanks to aplsimple).
    When opening files with browse command it doesn't keep the file path unless you provide it, so if you provide only a name for a file in current directory when you change directory shtmlview is not able to reopen the file, this happen when moving back
    and forward with several files opened. I think it would be better if you get the realpath of the file and always save the full path to the file to reload it.

    Also back and forward buttons only works with files but not with anchors inside a file.


    I don't know if those two characteristics are features or bugs, so I just report them for you knowledge and decide what to do (I feel more comfortable working as I expect, but it's just me)

    Anyway I find the megawidget pretty interesting and very usefull for documentation or guides. Thanks for your work.

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to D Groth on Fri Mar 11 07:22:55 2022
    In the current version on Github I added as well experimental support for display of Markdown files and support for embedded PNG images in HTML files, so files which are added using src="data:image/png;base64,<base encoded images>".

    So shtmlview is now a HTML and Markdown viewer ...

    D Groth

    D Groth schrieb am Freitag, 11. März 2022 um 10:41:40 UTC+1:
    Thanks for the reports. I now added as well support for backward and forward with internal anchors, and I used file normalize to store the complete file path. Not sure if this solves your change directory problem. It should ...
    Here again the download link: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview
    I hope this works. Please note that is very old code from a few famous Tcl coders (Uhler 1995, Flint 1999-2000, Heller 2002-2008 around) which I just merged together into this megawidget to make it usable for a broader community, so fixing and
    extending is not that easy ;)

    D Groth
    pd schrieb am Donnerstag, 10. März 2022 um 23:16:03 UTC+1:
    El jueves, 10 de marzo de 2022 a las 13:05:30 UTC+1, D Groth escribió:
    shtmlview is pur Tcl only snit megawidget to display a large subset of HTML. It should be used for local HTML files only for instance to display help pages within a Tk application.
    Version 0.9.3 adds support for mouse-wheel scrolling and contains bug-fixes for text copy and http(s) links and anchor links (thanks to aplsimple).
    When opening files with browse command it doesn't keep the file path unless you provide it, so if you provide only a name for a file in current directory when you change directory shtmlview is not able to reopen the file, this happen when moving back
    and forward with several files opened. I think it would be better if you get the realpath of the file and always save the full path to the file to reload it.

    Also back and forward buttons only works with files but not with anchors inside a file.


    I don't know if those two characteristics are features or bugs, so I just report them for you knowledge and decide what to do (I feel more comfortable working as I expect, but it's just me)

    Anyway I find the megawidget pretty interesting and very usefull for documentation or guides. Thanks for your work.

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From pd@21:1/5 to All on Sat Mar 12 13:37:21 2022
    El viernes, 11 de marzo de 2022 a las 10:41:40 UTC+1, D Groth escribió:
    Thanks for the reports. I now added as well support for backward and forward with internal anchors, and I used file normalize to store the complete file path. Not sure if this solves your change directory problem. It should ...

    now, it appears to work ok back and forward with several files but when in anchors even when back button is enable it generates this error if pushed:

    {
    Error reading C:/Users/prueba/Downloads/shtmlview/

    couldn't open "C:/Users/prueba/Downloads/shtmlview/": permission denied
    }

    shame errors appear in place of images when trying to load the images in an html file.

    Maybe it's a matter of windows OS and not a problem of the tcl source.


    D Groth
    pd schrieb am Donnerstag, 10. März 2022 um 23:16:03 UTC+1:

    When opening files with browse command it doesn't keep the file path unless you provide it, so if you provide only a name for a file in current directory when you change directory shtmlview is not able to reopen the file, this happen when moving back
    and forward with several files opened. I think it would be better if you get the realpath of the file and always save the full path to the file to reload it.

    Also back and forward buttons only works with files but not with anchors inside a file.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to All on Sun Mar 13 01:55:09 2022
    I fired up my Windows VM and I think I found the problem with the anchor links. The error for the should be now gone.
    Not sure about the images, png and gif images should be supported, even if they are in different folders. If there are jpeg images it might help to install the tkimg extension. I will look into the support of jpeg images.

    Here again the download link: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview

    pd schrieb am Samstag, 12. März 2022 um 22:37:24 UTC+1:
    El viernes, 11 de marzo de 2022 a las 10:41:40 UTC+1, D Groth escribió:
    Thanks for the reports. I now added as well support for backward and forward with internal anchors, and I used file normalize to store the complete file path. Not sure if this solves your change directory problem. It should ...
    now, it appears to work ok back and forward with several files but when in anchors even when back button is enable it generates this error if pushed:

    {
    Error reading C:/Users/prueba/Downloads/shtmlview/

    couldn't open "C:/Users/prueba/Downloads/shtmlview/": permission denied
    }

    shame errors appear in place of images when trying to load the images in an html file.

    Maybe it's a matter of windows OS and not a problem of the tcl source.
    D Groth
    pd schrieb am Donnerstag, 10. März 2022 um 23:16:03 UTC+1:

    When opening files with browse command it doesn't keep the file path unless you provide it, so if you provide only a name for a file in current directory when you change directory shtmlview is not able to reopen the file, this happen when moving
    back and forward with several files opened. I think it would be better if you get the realpath of the file and always save the full path to the file to reload it.

    Also back and forward buttons only works with files but not with anchors inside a file.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From pd@21:1/5 to All on Mon Mar 14 11:11:48 2022
    El domingo, 13 de marzo de 2022 a las 10:55:13 UTC+1, D Groth escribió:
    I fired up my Windows VM and I think I found the problem with the anchor links. The error for the should be now gone.
    Not sure about the images, png and gif images should be supported, even if they are in different folders. If there are jpeg images it might help to install the tkimg extension. I will look into the support of jpeg images.
    Here again the download link: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview

    Now the problems with permisions are fixed but I see other "problems":

    - It should be a button in the toolbar and/or an item in menu to close files, at least the visible file. Now there's no way to close and free an opened file, even if you want it anymore.

    - when you try to browse and non existant file, an error is generated, this is ok but the problem is the error is taken as an html file and opened in the browser and you also can navigate backward and forward as it were a real file [img3.png]. It would
    be better if the error is shown in stderr or console and never treated as a opened file.

    - urls in an html file are not managed properly, the browser tries to load them from a local path rather to access the url and download them previously. Maybe this program is intented to process local files and local resources only, but then it would be
    better if it doesn't try to load resources at all if there're not present in the local storage. The browser inserts into the file error messages indicating the resources cannot be found, I think there're only two options: 1) dowload them and load into
    the page, or 2) don't dowload anything and silently avoid error messages, just a blank.

    The problem is the browser treats url as relative or absolute paths in the current storage. The loaded html files has a line like:

    <img src="/2022/assets/logos/galpon.png" height="250" alt="Logo GALPon">

    and the browser tries to load image file /2022/assets/logos/galpon.png in root mount point rather than in web domain, as that file doesn't exists you get the error message:

    couldn't open "/2022/assets/logos/galpon.png": no such file or directory

    in place of the image.

    A similar problem appears when the image is fully indicated as an url with http protocol, a line like:

    <img src="https://www.avarcacastell.com/es/themes/theshop/img/langs/es.jpg" alt="Español">

    and the browser tries to load the image in "C:/Users/prueba/Downloads/https://wwww.avarcacastell.com/es/themes/theshop/img/langs/es.jpg" showing the error

    couldn't open "C:/Users/prueba/Downloads/https://wwww.avarcacastell.com/es/themes/theshop/img/langs/es.jpg" : no such file or directory

    instead of the image.

    Maybe you prefer to report this issues directly in github rather here in order not to pollute this list.

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to All on Mon Mar 14 22:32:57 2022
    Thanks for the report.

    A few issue can be fixed probably, but please: as stated in the documentation, the widget is not intended to be a web browser. It is a HTML and Markdown viewer for local files only, images and hyperlinks should be relative, so the widget should be used
    for instance embedded within your own application to display HTML or Markdown help pages or to browse local HTML/Markdown files which use relative links (absolute links are evil, we can't move things around). The Tcl documentation is a good example where
    this widget works. Absolute filenames and image links should work but nothing which assumes as webserver like "/img/" where this is a folder to the images on the server or http(s) addresses will work. Per default PNG images either using filenames in the
    src attribute or embedded as data-base64 encoded images are supported out of the box, jpeg images as well if tkimg is installed. SVG image support is a thing I am interested as well, may be using https://wiki.tcl-lang.org/page/svgconvert (as tksvg does
    not support text).

    From the issues you mentioned below I fixed the retrieval of non-existing files, so there in this case the link will be ignored, just giving a short error message. http(s) links and images should be now as well ignored without giving a Tk error or trying
    to browse them polluting thereby the history. The red text for an image which can't be shown, because it is an http(s) image is intended to inform the user.

    I am not sure what you mean, you would like to close a file. What should be shown instead in the widget? Should the text widget just be cleaned, or a default page should be shown instead? For instance a help page?

    If you need http(s) features, you should have a look at tkhtml3, this is a much faster and more powerful widget, but it is a binary extension, so you need to compile it for all platforms you would like to target. Look here for a comparison of the
    different HTML widgets.

    https://wiki.tcl-lang.org/page/HTML+widgets

    I think shtmlview is the only pure Tcl/Tk widget with support for HTML+Markdown and base64 encoded images.

    Indeed for bugs the github issue page is the better place, more general discussion may be better here.

    https://github.com/mittelmark/DGTcl/issues

    BTW: I am currently creating an own repo just for the shtmlview package alone.

    Hope this helps.
    DG

    pd schrieb am Montag, 14. März 2022 um 19:11:52 UTC+1:
    El domingo, 13 de marzo de 2022 a las 10:55:13 UTC+1, D Groth escribió:
    I fired up my Windows VM and I think I found the problem with the anchor links. The error for the should be now gone.
    Not sure about the images, png and gif images should be supported, even if they are in different folders. If there are jpeg images it might help to install the tkimg extension. I will look into the support of jpeg images.
    Here again the download link: https://downgit.github.io/#/home?url=https://github.com/mittelmark/DGTcl/tree/master/lib/shtmlview
    Now the problems with permisions are fixed but I see other "problems":

    - It should be a button in the toolbar and/or an item in menu to close files, at least the visible file. Now there's no way to close and free an opened file, even if you want it anymore.

    - when you try to browse and non existant file, an error is generated, this is ok but the problem is the error is taken as an html file and opened in the browser and you also can navigate backward and forward as it were a real file [img3.png]. It would
    be better if the error is shown in stderr or console and never treated as a opened file.

    - urls in an html file are not managed properly, the browser tries to load them from a local path rather to access the url and download them previously. Maybe this program is intented to process local files and local resources only, but then it would
    be better if it doesn't try to load resources at all if there're not present in the local storage. The browser inserts into the file error messages indicating the resources cannot be found, I think there're only two options: 1) dowload them and load into
    the page, or 2) don't dowload anything and silently avoid error messages, just a blank.

    The problem is the browser treats url as relative or absolute paths in the current storage. The loaded html files has a line like:

    <img src="/2022/assets/logos/galpon.png" height="250" alt="Logo GALPon">

    and the browser tries to load image file /2022/assets/logos/galpon.png in root mount point rather than in web domain, as that file doesn't exists you get the error message:

    couldn't open "/2022/assets/logos/galpon.png": no such file or directory

    in place of the image.

    A similar problem appears when the image is fully indicated as an url with http protocol, a line like:

    <img src="https://www.avarcacastell.com/es/themes/theshop/img/langs/es.jpg" alt="Español">

    and the browser tries to load the image in "C:/Users/prueba/Downloads/https://wwww.avarcacastell.com/es/themes/theshop/img/langs/es.jpg" showing the error

    couldn't open "C:/Users/prueba/Downloads/https://wwww.avarcacastell.com/es/themes/theshop/img/langs/es.jpg" : no such file or directory

    instead of the image.

    Maybe you prefer to report this issues directly in github rather here in order not to pollute this list.

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From pd@21:1/5 to All on Tue Mar 15 02:19:08 2022
    El martes, 15 de marzo de 2022 a las 6:33:01 UTC+1, D Groth escribió:

    A few issue can be fixed probably, but please: as stated in the documentation, the widget is not intended to be a web browser. It is a HTML and Markdown viewer for local files only, images and hyperlinks should be relative, so the widget should be used
    for instance embedded within your own application to display HTML or Markdown help pages or to browse local HTML/Markdown files which use relative links (absolute links are evil, we can't move things around). The Tcl documentation is a good example where
    this widget works. Absolute filenames and image links should work but nothing which assumes as webserver like "/img/" where this is a folder to the images on the server or http(s) addresses will work. Per default PNG images either using filenames in the
    src attribute or embedded as data-base64 encoded images are supported out of the box, jpeg images as well if tkimg is installed. SVG image support is a thing I am interested as well, may be using https://wiki.tcl-lang.org/page/svgconvert (as tksvg does
    not support text).

    Yes, I understand that, for that reason I said "Maybe this program is intented to process local files and local resources only", but the point is what to do when you command to browse a file containing non local references, for example an html file saved
    from a online web page. The point is how the program will perform with unexpected. I see this possibilities:

    1- the browser refuses to load the file with non local references
    2- the browser loads the files but ignores non local references
    3- the browser loads the file and tries to interpret non local references as local ones (current behaviour)

    I consider (3) a bug, (1) a non optimal solution and (2) the right solution, but that's only my opinion.

    The red text for an image which can't be shown, because it is an http(s) image is intended to inform the user.

    Another possibility is simply not loading the image and don't showing anything rendered (no image and no error), the absence of image is enough to inform the user something went wrong (and you can also lauch errors to stderr).


    I am not sure what you mean, you would like to close a file. What should be shown instead in the widget? Should the text widget just be cleaned, or a default page should be shown instead? For instance a help page?

    Every time you issue the command "browse <file>" you opened the file in the browser window and you can navigate for all opened files with backward and forward buttons. If I open several files, in certain moment of time maybe I'm not interested in viewing
    (browsing) one of the opened files, I'm not interested in having it opened anymore, so I want to close it and not pollute the opened files list, that is, I select "close the file" and from now, the file is vanished in the browser, I cannot reach the file
    when moving back and forward, and the file doesn't waste memory neither processing (i.e. if file resources are recalculated each time you visit the file).

    Indeed for bugs the github issue page is the better place, more general discussion may be better here.

    ok, I will make suggestions and issues there since now

    don't take my words as criticism, I value your widget and find it very interesting and usefull as a kind of "norton guide" local documentation, that's the reason I'm suggesting ideas to, in my opinion, improve it

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to D Groth on Tue Mar 15 04:11:06 2022
    from 1, 2, 3 and 4 it should currently do 2, that's my goal, if this works, I would think about 4 ;)

    D Groth schrieb am Dienstag, 15. März 2022 um 12:07:13 UTC+1:
    I think points 1-3 should be solved with the version currently on Github (the widget does not anymore tries to open files which are not there). Not sure yet if it is a good idea do hide an http(s) image simply completely without an error text in the
    HTML code, but probably for this is the alternate text between the image tag shown.

    I understand now that the close a file feature should remove the file from the history and load the previous file instead. And that the next widgets *browse* command might start a complete new history if requested. So for instance if I call the widget
    directly from the terminal with:

    $ tclsh shtmlview.tcl file1.html file2.html test.md

    or even
    $ tclsh shtmlview.tcl *.html *.md

    after closing file1.html from the widget therafter file2.html should be displayed and the history should be cleaned, so that I can process all files similar like in an image viewer where I can walk through the images of a directory with a single N key
    for instance.
    Right?

    We should discuss this in the new shtmlview repository https://github.com/mittelmark/shtmlview/issues in separate issue threads as the discussion becomes more an more tree like with different topics and suggestions ;)

    Simply open there for each issue / feature request an issue. So that we can back linearize the discussion ....
    pd schrieb am Dienstag, 15. März 2022 um 10:19:11 UTC+1:
    El martes, 15 de marzo de 2022 a las 6:33:01 UTC+1, D Groth escribió:

    A few issue can be fixed probably, but please: as stated in the documentation, the widget is not intended to be a web browser. It is a HTML and Markdown viewer for local files only, images and hyperlinks should be relative, so the widget should be
    used for instance embedded within your own application to display HTML or Markdown help pages or to browse local HTML/Markdown files which use relative links (absolute links are evil, we can't move things around). The Tcl documentation is a good example
    where this widget works. Absolute filenames and image links should work but nothing which assumes as webserver like "/img/" where this is a folder to the images on the server or http(s) addresses will work. Per default PNG images either using filenames
    in the src attribute or embedded as data-base64 encoded images are supported out of the box, jpeg images as well if tkimg is installed. SVG image support is a thing I am interested as well, may be using https://wiki.tcl-lang.org/page/svgconvert (as tksvg
    does not support text).
    Yes, I understand that, for that reason I said "Maybe this program is intented to process local files and local resources only", but the point is what to do when you command to browse a file containing non local references, for example an html file
    saved from a online web page. The point is how the program will perform with unexpected. I see this possibilities:

    1- the browser refuses to load the file with non local references
    2- the browser loads the files but ignores non local references
    3- the browser loads the file and tries to interpret non local references as local ones (current behaviour)

    I consider (3) a bug, (1) a non optimal solution and (2) the right solution, but that's only my opinion.
    The red text for an image which can't be shown, because it is an http(s) image is intended to inform the user.
    Another possibility is simply not loading the image and don't showing anything rendered (no image and no error), the absence of image is enough to inform the user something went wrong (and you can also lauch errors to stderr).

    I am not sure what you mean, you would like to close a file. What should be shown instead in the widget? Should the text widget just be cleaned, or a default page should be shown instead? For instance a help page?
    Every time you issue the command "browse <file>" you opened the file in the browser window and you can navigate for all opened files with backward and forward buttons. If I open several files, in certain moment of time maybe I'm not interested in
    viewing (browsing) one of the opened files, I'm not interested in having it opened anymore, so I want to close it and not pollute the opened files list, that is, I select "close the file" and from now, the file is vanished in the browser, I cannot reach
    the file when moving back and forward, and the file doesn't waste memory neither processing (i.e. if file resources are recalculated each time you visit the file).
    Indeed for bugs the github issue page is the better place, more general discussion may be better here.
    ok, I will make suggestions and issues there since now

    don't take my words as criticism, I value your widget and find it very interesting and usefull as a kind of "norton guide" local documentation, that's the reason I'm suggesting ideas to, in my opinion, improve it

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D Groth@21:1/5 to All on Tue Mar 15 04:07:10 2022
    I think points 1-3 should be solved with the version currently on Github (the widget does not anymore tries to open files which are not there). Not sure yet if it is a good idea do hide an http(s) image simply completely without an error text in the HTML
    code, but probably for this is the alternate text between the image tag shown.

    I understand now that the close a file feature should remove the file from the history and load the previous file instead. And that the next widgets *browse* command might start a complete new history if requested. So for instance if I call the widget
    directly from the terminal with:

    $ tclsh shtmlview.tcl file1.html file2.html test.md

    or even
    $ tclsh shtmlview.tcl *.html *.md

    after closing file1.html from the widget therafter file2.html should be displayed and the history should be cleaned, so that I can process all files similar like in an image viewer where I can walk through the images of a directory with a single N key
    for instance.
    Right?

    We should discuss this in the new shtmlview repository https://github.com/mittelmark/shtmlview/issues in separate issue threads as the discussion becomes more an more tree like with different topics and suggestions ;)

    Simply open there for each issue / feature request an issue. So that we can back linearize the discussion ....

    pd schrieb am Dienstag, 15. März 2022 um 10:19:11 UTC+1:
    El martes, 15 de marzo de 2022 a las 6:33:01 UTC+1, D Groth escribió:

    A few issue can be fixed probably, but please: as stated in the documentation, the widget is not intended to be a web browser. It is a HTML and Markdown viewer for local files only, images and hyperlinks should be relative, so the widget should be
    used for instance embedded within your own application to display HTML or Markdown help pages or to browse local HTML/Markdown files which use relative links (absolute links are evil, we can't move things around). The Tcl documentation is a good example
    where this widget works. Absolute filenames and image links should work but nothing which assumes as webserver like "/img/" where this is a folder to the images on the server or http(s) addresses will work. Per default PNG images either using filenames
    in the src attribute or embedded as data-base64 encoded images are supported out of the box, jpeg images as well if tkimg is installed. SVG image support is a thing I am interested as well, may be using https://wiki.tcl-lang.org/page/svgconvert (as tksvg
    does not support text).
    Yes, I understand that, for that reason I said "Maybe this program is intented to process local files and local resources only", but the point is what to do when you command to browse a file containing non local references, for example an html file
    saved from a online web page. The point is how the program will perform with unexpected. I see this possibilities:

    1- the browser refuses to load the file with non local references
    2- the browser loads the files but ignores non local references
    3- the browser loads the file and tries to interpret non local references as local ones (current behaviour)

    I consider (3) a bug, (1) a non optimal solution and (2) the right solution, but that's only my opinion.
    The red text for an image which can't be shown, because it is an http(s) image is intended to inform the user.
    Another possibility is simply not loading the image and don't showing anything rendered (no image and no error), the absence of image is enough to inform the user something went wrong (and you can also lauch errors to stderr).

    I am not sure what you mean, you would like to close a file. What should be shown instead in the widget? Should the text widget just be cleaned, or a default page should be shown instead? For instance a help page?
    Every time you issue the command "browse <file>" you opened the file in the browser window and you can navigate for all opened files with backward and forward buttons. If I open several files, in certain moment of time maybe I'm not interested in
    viewing (browsing) one of the opened files, I'm not interested in having it opened anymore, so I want to close it and not pollute the opened files list, that is, I select "close the file" and from now, the file is vanished in the browser, I cannot reach
    the file when moving back and forward, and the file doesn't waste memory neither processing (i.e. if file resources are recalculated each time you visit the file).
    Indeed for bugs the github issue page is the better place, more general discussion may be better here.
    ok, I will make suggestions and issues there since now

    don't take my words as criticism, I value your widget and find it very interesting and usefull as a kind of "norton guide" local documentation, that's the reason I'm suggesting ideas to, in my opinion, improve it

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Leitgeb@21:1/5 to [email protected] on Tue Mar 15 11:06:20 2022
    pd <[email protected]> wrote:
    1- the browser refuses to load the file with non local references
    2- the browser loads the files but ignores non local references
    3- the browser loads the file and tries to interpret non local references as local ones (current behaviour)

    I'd add a 4th option as a further suggestion:
    4- on klicking an external link it could offer to open it with a real
    browser.


    don't take my words as criticism, I value your widget and find it very interesting and usefull as a kind of "norton guide" local documentation, that's the reason I'm suggesting ideas to, in my opinion, improve it

    regards

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From pd@21:1/5 to All on Tue Mar 15 06:36:50 2022
    El martes, 15 de marzo de 2022 a las 12:07:13 UTC+1, D Groth escribió:

    I understand now that the close a file feature should remove the file from the history and load the previous file instead. And that the next widgets *browse* command might start a complete new history if requested. So for instance if I call the widget
    directly from the terminal with:

    I've created an issue in your project at github

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