Turn Any Docs Site Into Clean Markdown for RAG (Python, No Dependencies) A developer published a dependency-free Python script that converts documentation pages into clean Markdown for retrieval-augmented generation pipelines, using only the standard library's HTMLParser and urllib. The tool keeps the main content region, strips navigation, headers, footers, scripts and ARIA landmarks, and preserves headings, lists, inline code and fenced code blocks so headings can serve as chunk boundaries. In a test run against Python's json module documentation, it produced roughly 3,810 words of Markdown with no menus or breadcrumbs. If you're building a RAG chatbot or giving an AI agent "the docs", the first problem is boring: web pages are 80% navigation, footers, cookie banners, and script tags. Feed that raw HTML to an embedding model and your chunks fill up with "Skip to main content" and menu links. What you want is the main content as Markdown : headings kept they make great chunk boundaries , code blocks fenced, lists intact, and everything else gone. Standard library only. It keeps