Show HN: Defuddle, an HTML-to-Markdown alternative to Readability

github.com

365 points by kepano 21 hours ago


Defuddle is an open-source JS library I built to parse and extract the main content and metadata from web pages. It can also return the content as Markdown.

I built Defuddle while working on Obsidian Web Clipper[1] (also MIT-licensed) because Mozilla's Readability[2] appears to be mostly abandoned, and didn't work well for many sites.

It's still very much a work in progress, but I thought I'd share it today, in light of the announcement that Mozilla is shutting down Pocket. This library could be helpful to anyone building a read-it-later app.

Defuddle is also available as a CLI:

https://github.com/kepano/defuddle-cli

[1] https://github.com/obsidianmd/obsidian-clipper

[2] https://github.com/mozilla/readability

miketromba - 15 minutes ago

Excellent work. A modern alternative to readability was much needed. This is especially useful for building clean web context for LLMs. Thanks for open-sourcing this!

tmpfs - 20 hours ago

Interesting as I was researching this recently and certainly not impressed with the quality of the Readability implementations in various languages. Although Readability.js was clearly the best, it being Javascript didn't suit my project.

In the end I found the python trifatura library to extract the best quality content with accurate meta data.

You might want to compare your implementation to trifatura to see if there is room for improvement.

creakingstairs - 19 hours ago

I was just looking at obsidian web-clipper's source code because I've been quite impressed at its markdown conversion results and came across Defuddle in there. I'll be using for my bespoke read-it-later/ knowledge-base app, so thank you in advance :D

infogulch - an hour ago

Since it's written in javascript is there any chance it could be packaged as a bookmarklet?

binarymax - 5 hours ago

Really nice work. I appreciate the example with JSDOM as that’s exactly how I use readability, and this looks like a nice drop-in replacement.

Question: How did you validate this? You say it works better than readability but I don’t see any tests or datasets in the repo to evaluate accuracy or coverage. Would it be possible to share that as well?

Tsarp - 15 hours ago

Been using the obsidian clipper since it was out and this is a really neat. The per website profile based extraction is awesome.

Even if you are not a obsidian user, the markdown extraction quality is the most reliable Ive seen.

ahsd1 - 2 hours ago

Cool. Im looking for something similar but for stripping signatures and boilerplate disclaimers from html email. Could this work for that?

acrophobic - 16 hours ago

Is Mozilla's Readability really abandoned? The latest release (v0.6.0) is just 2 months ago, and its maintainer (Gijs) is pretty active on responding issues.

jeanlucas - 17 hours ago

Obsidian Web Clipper is a great tool to turn chatGPT conversations in markdown, or to just print it (believe me, it is a user case)

severusdd - 8 hours ago

This is very cool! Given how messy and busy many websites have become, we really need a robust markdown converter that lets readers focus on reading the content. Nice to see something stepping up where Readability left off.

Thank you for picking up this work :-)

ricardonunez - 7 hours ago

I’ll give it a try. I’m not happy with my current setup for markdown to HTML on the wysiwyg editor I’m using, this may provide better results if I go with my own tool bar and editor.

jonplackett - 12 hours ago

Does anyone know why readers don’t work for some websites where it looks like they should - ie normal article with lots of text.

You just get a completely white page (on the iPhone reader). Usually it’s a news website.

Is this the website intentionally obscuring the content to ensure they can serve their ads? If so how do they go about it?

shrinks99 - 17 hours ago

I've been super happy with Obsidian Web Clipper! It's worked really well for me with the one exception of importing publish dates (which is more than forgivable !)

rcarmo - 21 hours ago

The Python analogues seem to be well maintained. I did my own implementation of the Readability algorithm years ago and dropped it in favor them, and I have a few scrapers going strong with regular updates.

ulrischa - 10 hours ago

I have build something similar:https://devkram.de/markydown but with php. Easy for self hosting

- 10 hours ago
[deleted]
Andr2Andr - 10 hours ago

Serious question - who and why would be using this tool? What is the use case? In other comments I have only seen exporting ChatGPT conversations to md

timdeve - 10 hours ago

Looks good, I'm gonna try to swap readability in my RSS reader with this.

And with Pocket going away I might have to add save it later to it...

inhumantsar - 19 hours ago

can confirm that readability seems to be on life support. I used it slurp, an obsidian plugin which serves the same basic purpose as web clipper, and always had a hard time getting PRs reviewed and merged.

i started working on my own alternative but life (and web clipper) derailed the work.

it's funny. somehow slurp keeps gaining new users even though web clipper exists. so i might have to refactor it to use your library sometime soon even though I don't use slurp myself anymore.

billconan - 20 hours ago

Are you using ai models behind the scenes? I saw Gemini and others in the code. I am asking mainly to understand the cost of using yours vs. readability. Thank!

90s_dev - 19 hours ago

Neat. With ~3 more lines of code, you could get a URL and render it in simpler HTML and be a full fledged replacement.

khaki54 - 17 hours ago

seems pretty much perfect including obsidian clipper. Thanks!

ioma8 - 9 hours ago

Tried it on some webpages, doesnt work well.

revskill - 11 hours ago

Interesting that Markdown does not support form element.

busymom0 - 21 hours ago

In the playground, after I enter a url, I can't seem to figure out how to submit it to fetch the url? I tried pressing the return key on iOS keyboard but it didn't do anything. Am I missing something?

input_sh - 19 hours ago

A bit off-topic, but I'm very excited to see the launch of Bases! I've obsessively followed the roadmap for like a year awaiting this day and have been frequently disappointed to still see it stuck somewhere under "planned".

Not that I didn't already implement a read-it-later solution with Obsidian+Dataview, but this definitely makes things simpler!

fkfyshroglk - 20 hours ago

For those not in the know: [Readability](https://github.com/mozilla/readability)

andrethegiant - 19 hours ago

[flagged]

latchkey - 18 hours ago

[flagged]