home.social

#html2text — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #html2text, aggregated by home.social.

fetched live
  1. #html2text (the Python tool, alir3z4.github.io/html2text, in Debian as python3-html2text which then provides a "html2markdown" binary) converts HTML into Markdown and (with the right CLI options) does a pretty good job, too.

    From there, you can use a good Markdown renderer like lowdown to get an awesome experience – _if_ your terminal supports OSC 8 hyperlinks.

    Like, look at this. It still has a few quirks, but for an HTML email in the terminal? It's fucking beautiful.

    But no OSC 8 in #NeoMutt. 😔

  2. #ELinks with `-dump-color-mode 2 -colors 1` has colors and numbered links

    #links2 with `-html-numbered-links 1` is monochrome, but has numbered links

    #Lynx too, but its output looks more messy to me.

    #w3m doesn't highlight links and doesn't output link URLs at all.

    #Pandoc can't handle table layouts, which unfortunately are still very common in commercial emails.

    #HTML2Text (the C++ tool, gitlab.com/grobian/html2text) does a decent job and supports bold & underline in `less` and NeoMutt's pager.

  3. I've just published #html2text 0.11.0. Mainly a few bugfixes, but I've also had to bump the MSRV to 1.63 due to some dependencies. That's the version on Debian stable, so that seems like a reasonable point.

    crates.io/crates/html2text

    I have given up on running the tests in CI on the minimum supported rust version, though - it didn't seem worth adding workarounds to pin dependencies of dev-dependencies to old versions supporting 1.63.

  4. ...quickly followed by #html2text 0.10.1 to fix another bug.

  5. I just released #html2text 0.10.0 (my #RustLang crate to convert HTML into plain (or not) text suitable for display in a terminal.
    This release adds some more CSS support including background-color and inline style attributes, and fixes some annoying duplicated empty lines, mostly when there are nested and mostly empty tables.
    Things will slow down again for a bit now!

  6. That's better. I've released #html2text 0.7.1, adding a bit of extra CSS support, notably:
    * recognise display: none
    * Config::add_css(), which allows adding new CSS rules to apply.

    My aoc-cli PR now uses `.add_css(".lavafall: { display: none }")` to work around the bad output.

  7. Well that's annoying. Having added CSS colours to #html2text just so that the #AdventOfCode calendar looks good, it's changed so that it doesn't look so good anymore...

  8. I've released #html2text 0.7.0, a #RustLang crate for converting HTML into text for the terminal.

    crates.io/crates/html2text

    The main new feature is some CSS support (behind a feature flag). It's minimal, but enough to handle the Advent of Code calendar. I expect to fill in more CSS cases in future (PRs or issues welcome), up to a point - definitely not aiming for a full browser styling engine here.

    github.com/jugglerchris/rust-h

  9. I've finally found motivation to add some experimental minimal CSS colour support to the #html2text #RustLang crate.
    Next step is to see if I can update aoc-cli to make use of this. 🙂

  10. Looks like the next release of the #html2text crate will have an MSRV version bump to 1.60, because the log crate (an indirect dependency) has too.

    I'm currently inclined to think that an MSRV bump counts as an ABI break, so I think I will bump the minor version.

    #Rust

  11. Absolutament genial!
    Crec que ja puc dir adéu amb la ma oberta a la llibreria #BeatifulSoup 👋
    #html2text de #AaronSwartz funciona millor!

  12. El que encara no he provat és com es comporta amb els enllaços la configuració que li he posat a #html2text de #mastotuit.
    A veure amb aquest:

    pypi.org/project/html2text/

  13. He modificat #mastotuit per a que faci servir la llibreria #html2text de #AaronSwartz.
    Aquesta publicació és la primera en fer servir la llibreria del mític Aaron Swartz.

  14. is an to text converter.

    html2text converts structured HTML into plain text. html2text supports converting several files and concatenating them on output. html2text fully supports HTML 3.2, most of HTML 4, and can deal with HTML 5 using reasonable guesses for what should be done. html2text can generate output with escape codes.

    Website 🔗️: github.com/grobian/html2text

    apt 📦️: html2text

  15. @brainblasted There are also several programs that could be helpful. Here's one I've used before (written in Python): github.com/aaronsw/html2text