[PR #2971] [MERGED] feat: replace regex README parser with markdown-it-py AST parser #11303

Closed
opened 2026-04-24 06:05:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vinta/awesome-python/pull/2971
Author: @vinta
Created: 3/18/2026
Status: Merged
Merged: 3/18/2026
Merged by: @vinta

Base: masterHead: feature/markdown-it-py-parser


📝 Commits (10+)

  • 5fa7c7d feat(website): add markdown-it-py README parser and inline renderer tests
  • 1c67c9f feat: replace regex README parser with markdown-it-py AST parser
  • 3d015bc feat(parser): implement entry extraction from bullet list AST nodes
  • a838098 feat: implement HTML rendering for readme sections
  • 03ac212 test: add integration tests against the real README.md
  • 0f37497 refactor: extract parsing logic from build.py into readme_parser module
  • 143abbf build: remove markdown dependency, replaced by markdown-it-py
  • af3baab refactor: consolidate load_cache into build.load_stars
  • 266a6b6 simplify: remove redundant _has_description, unused param, merge loops
  • 74bba50 build: restructure dependency groups and add watchdog

📊 Changes

15 files changed (+2527 additions, -1441 deletions)

View changed files

📝 Makefile (+16 -9)
📝 pyproject.toml (+17 -9)
📝 uv.lock (+61 -12)
📝 website/build.py (+25 -277)
📝 website/data/github_stars.json (+1274 -750)
📝 website/fetch_github_stars.py (+8 -17)
website/readme_parser.py (+388 -0)
website/static/favicon.svg (+6 -0)
📝 website/static/main.js (+142 -4)
📝 website/static/style.css (+132 -23)
📝 website/templates/base.html (+12 -15)
📝 website/templates/index.html (+21 -14)
📝 website/tests/test_build.py (+1 -289)
📝 website/tests/test_fetch_github_stars.py (+0 -22)
website/tests/test_readme_parser.py (+424 -0)

📄 Description

Summary

  • Replaced the regex-based README parser with a proper AST parser using markdown-it-py, improving correctness and maintainability
  • Added website/readme_parser.py module with full entry extraction, HTML rendering, and 94 passing unit + integration tests
  • Extended the website with client-side features: column sorting (name, stars, last commit), URL-reflected search/filter state, relative time display, and improved table accessibility/mobile layout
  • Replaced pushed_at with last_commit_at (fetched from default branch) for more accurate recency data
  • Misc: extracted favicon to static SVG, live-reload preview, simplified Makefile, CSS transitions and polish

Test plan

  • make test — all 94 tests pass
  • make build — site builds without errors
  • make preview — verify table sorting, search/filter URL state, expanded rows, and mobile layout in browser

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/vinta/awesome-python/pull/2971 **Author:** [@vinta](https://github.com/vinta) **Created:** 3/18/2026 **Status:** ✅ Merged **Merged:** 3/18/2026 **Merged by:** [@vinta](https://github.com/vinta) **Base:** `master` ← **Head:** `feature/markdown-it-py-parser` --- ### 📝 Commits (10+) - [`5fa7c7d`](https://github.com/vinta/awesome-python/commit/5fa7c7d1a670387dc04b6408a06e7b1a6dbbbf42) feat(website): add markdown-it-py README parser and inline renderer tests - [`1c67c9f`](https://github.com/vinta/awesome-python/commit/1c67c9f0e68718cd23f885d11a9168d8d0d53980) feat: replace regex README parser with markdown-it-py AST parser - [`3d015bc`](https://github.com/vinta/awesome-python/commit/3d015bc63026635087701358237d9ddb60fb67d7) feat(parser): implement entry extraction from bullet list AST nodes - [`a838098`](https://github.com/vinta/awesome-python/commit/a83809886c3fe8281ebcb4c814ab3568e6a93cba) feat: implement HTML rendering for readme sections - [`03ac212`](https://github.com/vinta/awesome-python/commit/03ac212880d2e27bdeccfdcacfec0e090aafdfd4) test: add integration tests against the real README.md - [`0f37497`](https://github.com/vinta/awesome-python/commit/0f374970dd6dce9c8827912a191da79fa0c3a5ec) refactor: extract parsing logic from build.py into readme_parser module - [`143abbf`](https://github.com/vinta/awesome-python/commit/143abbf2016d524c95a586f32259d27673aaa77d) build: remove markdown dependency, replaced by markdown-it-py - [`af3baab`](https://github.com/vinta/awesome-python/commit/af3baab2ed798b7bcfd26c3f2a5043bddb624091) refactor: consolidate load_cache into build.load_stars - [`266a6b6`](https://github.com/vinta/awesome-python/commit/266a6b6b6ca6375b001758b9da4463bc71c02b43) simplify: remove redundant _has_description, unused param, merge loops - [`74bba50`](https://github.com/vinta/awesome-python/commit/74bba5078520c706a23d9426d278e09e1e5dac75) build: restructure dependency groups and add watchdog ### 📊 Changes **15 files changed** (+2527 additions, -1441 deletions) <details> <summary>View changed files</summary> 📝 `Makefile` (+16 -9) 📝 `pyproject.toml` (+17 -9) 📝 `uv.lock` (+61 -12) 📝 `website/build.py` (+25 -277) 📝 `website/data/github_stars.json` (+1274 -750) 📝 `website/fetch_github_stars.py` (+8 -17) ➕ `website/readme_parser.py` (+388 -0) ➕ `website/static/favicon.svg` (+6 -0) 📝 `website/static/main.js` (+142 -4) 📝 `website/static/style.css` (+132 -23) 📝 `website/templates/base.html` (+12 -15) 📝 `website/templates/index.html` (+21 -14) 📝 `website/tests/test_build.py` (+1 -289) 📝 `website/tests/test_fetch_github_stars.py` (+0 -22) ➕ `website/tests/test_readme_parser.py` (+424 -0) </details> ### 📄 Description ## Summary - Replaced the regex-based README parser with a proper AST parser using `markdown-it-py`, improving correctness and maintainability - Added `website/readme_parser.py` module with full entry extraction, HTML rendering, and 94 passing unit + integration tests - Extended the website with client-side features: column sorting (name, stars, last commit), URL-reflected search/filter state, relative time display, and improved table accessibility/mobile layout - Replaced `pushed_at` with `last_commit_at` (fetched from default branch) for more accurate recency data - Misc: extracted favicon to static SVG, live-reload preview, simplified Makefile, CSS transitions and polish ## Test plan - [x] `make test` — all 94 tests pass - [x] `make build` — site builds without errors - [x] `make preview` — verify table sorting, search/filter URL state, expanded rows, and mobile layout in browser 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-24 06:05:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-python#11303