Python tool converts HTML pages to Markdown chunks and tracks section-level changes
A developer has built a Python tool using only the standard library that converts web pages into clean, structured Markdown for use in search indexes or retrieval-augmented generation (RAG) pipelines. The script parses HTML into a tree, strips navigation and decorative elements, and renders content as CommonMark Markdown with GitHub Flavored pipe tables. It splits the output into named sections based on heading paths, then compares two versions of a page to classify each section as added, removed, renamed, changed, links-only, or unchanged. The approach was demonstrated using Python 3.13 and 3.14 documentation pages fetched from docs.python.org. This allows targeted re-embedding of only modified chunks rather than reprocessing an entire page on each update.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in