Hacker GitHub

← All repos

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

Mentions per year 11 mentions · busiest year 2024 (9)
20082026
  1. …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..
  2. possibly something like https://github.com/romansky/dom-to-semantic-markdown could also help for this use case.
  3. 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…
  4. …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/
  5. Done! https://github.com/romansky/dom-to-semantic-markdown/issues/...
  6. This is now supported, see here- https://github.com/romansky/dom-to-semantic-markdown?tab=rea...
  7. …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…
  8. Please see here- https://github.com/romansky/dom-to-semantic-markdown/blob/ma...
  9. 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…
  10. 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...