I have wondered many times.

Of course I can always use a browser but it’s overkill.

The same goes for yad or zenity, they pull in webkit which is a full-fledged browser engine, and at least yad does not have an offline mode.

I just want to look at some local HTML (incl. images) & CSS styling.

  • Onno (VK6FLAB)@lemmy.radio
    link
    fedilink
    arrow-up
    23
    ·
    8 days ago

    A browser is specifically designed for rendering HTML and does it better than anything else.

    However, if you must, you can use something like pandoc to convert the HTML to something else, like a PDF or an Office document.

    An alternative is to use a text only browser like lynx.

    The ides that a browser is overkill is only true if you don’t already have one installed and only if you’re happy to put up with half baked rendering.

    So … use a browser.

    • That’s good advice, but I beg to differ about the perspective on browsers.

      There are a very few browsers that only render content. Most do much more: tabs, bookmark management, cookie management, password management, plugins/extensions/add-ons, history management, JavaScript, downloads management… they’re full-on mini desktops, and they do much more than just render content. And all of this - while useful and desirable to many people - costs, in compute and especially in memory. Unless you’re running an Electron app, odds are that your the browser is the single largest consumer of memory on your computer at the monogamy moment. If I run Firefox, it even tops Factorio with multi-planet factories.

      Unfortunately, Acid2 compliance is very complex, and the content of many websites is inaccessible without JavaScript, so the idea of just something like Evince for HTML isn’t pragmatic. However, having an engine that only renders CSS and XHTML could still be useful. Many sites are either JS-free, or the JavaScript only adds functionality that might be irrelevant to the content: commenting and feedback support, for example.

      Gemini has failed, but a really pared down browser can still be valuable, and a fair portion of the web is still browsable without JavaScript. I think OP’s question is entirely rational, and practical.

      An example that illustrates my point is epub, which is just xhtml and assets in a zip: images, yes. JavaScript, no. I can imagine a wrapper that does the networking to fetch assets, bundles the allowable ones into epub, and then runs an epub renderer. It would be an order of magnitude smaller, and cleaner, than even one of the minimalist WebKit browsers like luakit, surf, or vimb.

      I run the smallest browser I can, and only open Firefox when I hit a site I both a) want to see, and b) requires JavaScript to be at all functional. Most online shopping stores fall into this category, but banking’s another. I don’t begrudge the more demanding requirements of those sites, but I don’t want the needless resource consumption of Firefox when the sites don’t require it.

      • Onno (VK6FLAB)@lemmy.radio
        link
        fedilink
        arrow-up
        5
        ·
        7 days ago

        Arguing about which browser does not make much sense to me because ultimately to render HTML with CSS in the way that the designer expected is the whole reason you need CSS.

        ePub is interesting, but the functionality supported in the HTML is limited, as is CSS support.

        You make an interesting point about JavaScript, but in my experience, the use of it is increasing, not decreasing.

        I never said that Firefox, Chrome or Safari was required, there are plenty of light(er) weight browsers around, there’s even a Wikipedia page about it:

        https://en.m.wikipedia.org/wiki/Comparison_of_lightweight_web_browsers

        My point stands, use a browser.

  • nesc@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    14
    ·
    8 days ago

    If you have a browser already installed installing another one is an overkill.

  • inkeso@feddit.org
    link
    fedilink
    arrow-up
    12
    ·
    8 days ago

    Well if you want modern CSS3-support or even JS you have to go for a browser. You could try NetSurf which is a very small & fast but only supports CSS2. Or Dillo, which is even smaller & faster (but also more limited in terms of CSS support)

    • Those are great suggestions; I don’t use them only because neither is keyboard oriented, so I tend to vacillate between Luakit, Surf, vimb, and Nyxt (although the last still has serious hard-hanging issues and an obscene configuration).

      On this topic, I’d be interested in a terminal browser that tries harder on the layout front. w3m, links, links2, elinks - they all work, but none focus on layout and rendering even as much as terminal Markdown renderers such as glow and hike.

    • Colloidal
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 days ago

      +1 for Dillo. Yes, it’s limited, it’s largely abandoned for the past 10 years and you won’t run web apps on it. But it is indeed blazingly fast and very low on resources, like OP requested. I didn’t know NetSurt, thanks for that!