romansky/dom-to-semantic-markdown
View on GitHub ↗ ★ 1,002 TypeScript
DOM to Semantic-Markdown for use with LLMs
11 mentions on Hacker News by 6 people: 1 story, 10 comments · first 2024-07-23 · latest 2025-07-02
20082026
-
…first turn it into markdown with a library that preserves semantic web structures (I authored this- https://github.com/romansky/dom-to-semantic-markdown ) saving many tokens = much less energy used..
comment by leroman · 2025-07-02 · in Show HN: Spegel, a Terminal Browser That Uses LLMs to Rewrite Webpages -
possibly something like https://github.com/romansky/dom-to-semantic-markdown could also help for this use case.
comment by kanzure · 2025-05-18 · in Show HN: A web browser agent in your Chrome side panel -
I found that reducing html down to markdown using turndown or https://github.com/romansky/dom-to-semantic-markdown works well; if you want the AI to be able to select stuff, give it cheerio or jQuery access to navigate through the html…
comment by yawnxyz · 2024-09-06 · in Minifying HTML for GPT-4o: Remove all the HTML tags -
…the "problem" we've had decent success, even with GPT-4o mini. [0] https://github.com/extractus [1] https://github.com/romansky/dom-to-semantic-markdown [2] https://apify.com/ [3] https://www.firecrawl.dev/ [4] https://magicloops.dev/
comment by jumploops · 2024-09-02 · in Web scraping with GPT-4o: powerful but expensive -
Done! https://github.com/romansky/dom-to-semantic-markdown/issues/...
comment by richardreeze · 2024-07-26 · in Show HN: Convert HTML DOM to semantic markdown for use in LLMs -
This is now supported, see here- https://github.com/romansky/dom-to-semantic-markdown?tab=rea...
comment by leroman · 2024-07-24 · in Show HN: Convert HTML DOM to semantic markdown for use in LLMs -
…as htmlToMarkdownAST). And now that I look at the source it's kind of abstract but not entirely: https://github.com/romansky/dom-to-semantic-markdown/blob/ma... – when writing code like this I also find keeping the AST fairly abstract also…
comment by ianbicking · 2024-07-23 · in Show HN: Convert HTML DOM to semantic markdown for use in LLMs -
Please see here- https://github.com/romansky/dom-to-semantic-markdown/blob/ma...
comment by leroman · 2024-07-23 · in Show HN: Convert HTML DOM to semantic markdown for use in LLMs -
Thank you! this is exactly why there's support for this specific use case- https://github.com/romansky/dom-to-semantic-markdown/blob/ma... (see `findContentByScoring`) And if you pass an optional flag `extractMainContent` it will use some…
comment by leroman · 2024-07-23 · in Show HN: Convert HTML DOM to semantic markdown for use in LLMs -
You might find this useful- just added code & instructions on how to make it a global CLI utility- https://github.com/romansky/dom-to-semantic-markdown/blob/ma...
comment by leroman · 2024-07-23 · in Show HN: Convert HTML DOM to semantic markdown for use in LLMs -
▲ 146
Show HN: Convert HTML DOM to semantic markdown for use in LLMsstory by leroman · 2024-07-23 · 56 comments