Add hadith section: 10 collections, 36,512 hadith (EN + AR + HI) + full-text search + page-level content filter#38
Conversation
Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
|
Nice work @copilot ; Now Add these The search page, dropdown selection, and filter(s) [like those of used in The Qur'an website in /docs]. |
…n, direct links Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
Done in commit Collection dropdown — "All Collections" or any individual collection Search data lives in Here is a preview of the search page UI: The page source shows all 10 collections in the dropdown, English/Arabic/Hindi field pills, and the full search + results + pagination infrastructure matching the Qur'an search design. |
|
@copilot ; restyle it like how the Qur'an's surahs are structured in their specific pages, and also implement page level filter (like it is in surah pages) and so on. |
…rk mode, mobile layout Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
Done in commit "✔ Hadith & Content Filter" panel (collapsible
Book nav dropdown — "☁ Jump to Book…" Also:
All 370 HTML pages regenerated. |
|
Nice work @copilot but THERE ARE MANY VERSES NOT PRESENT IN THE WHOLE OF MANY HADITHS , THEY ARE EMPTY OF HADITHS!!! |
…rect counts Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
Fixed in commit Changes made:
Valid hadiths shown: 36,108 (from 36,512 raw entries — 404 empty stubs removed). |
|
@copilot ; well you did a job, but why there are hadiths missing like why some starts from 3 , why some has only some numbers of hadiths and are remaining, and also some has reference remaining and so on and on why is that!!! Fix all of em! But before doing it do a comprehensive analysis in-depth about every single hadiths present and which are missing, where technical error is occurring and so on!! |
…page cleanup - Add _resolve_sec() to gen_large_collection_pages() that uses math.floor(n) for fractional hadith numbers and nearest-preceding section for gap hadiths. 72 hadiths (Bukhari 26, Tirmidhi 37, IbnMajah 2, Nasai 7) now appear in their correct book pages instead of a spurious "General" (book-000) page. - Fix reference row condition: was 'book!=0 AND hadith!=0'; now 'hadith!=0'. IbnMajah's 266 Introduction hadiths (book=0, hadith=N) now show references. Format: 'Hadith N' when book=0, 'Book X, Hadith Y' otherwise. - Add cleanup loop to remove stale per-book HTML files no longer generated. - Regenerate all 370+ docs/hadith/ pages. Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
Done in commit Root causes identified:
Fixes applied:
Page count changes:
|
No hadith data existed in the repo. Adds a complete hadith section sourced from fawazahmed0/hadith-api covering all major Sunni collections with English + Arabic, and hand-curated Hindi for An-Nawawi's 40. Includes a full-text search page with collection dropdown and field filters, and per-page content filter panels styled like the Qur'an surah pages.
Collections (36,512 hadith total)
New files
src/gen_hadith_html.py— single generator; downloads from jsDelivr CDN, caches todata/hadith/*.json.zip, then regenerates all HTML + txt + search data. Re-runnable.data/hadith/— 10 compressed.json.zipsource filesdocs/hadith/— 370+ HTML pages: collection index, small-collection single pages, large-collection per-book pages with prev/next navigation; plussearch.htmldocs/hadith/sd/— 31 search data JSON files (meta + EN + AR per collection; Hindi for Nawawi), lazy-loaded by the search pageoutput/hadith/— 21 plain-text files (EN + AR per collection; HI for Nawawi)docs/index.html— Hadith section link injected before</main>Search page (
docs/hadith/search.html)<mark class="hl">#h{n}anchor on the relevant page?q=...&coll=...params auto-trigger the search on loadPage-level content filter (like Qur'an surah pages)
Every hadith reading page now carries a collapsible "✔ Hadith & Content Filter" panel (
<details class="verse-chooser">):localStoragelocalStorage<select>in the header of every large-collection book page (Bukhari, Muslim, etc.), with the current book pre-selected<a href="#h{n}">link#h{N}deep links trigger a gold pulse animation on the target rowDesign notes
id="h{n}"anddata-hadith="{n}"attributes enabling direct deep-linking and JS-driven row filteringint()coercion on book IDs prevents path injectiontruncate_words()✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.