Tutorial 14: Ayah Theme End-to-End
This tutorial is for users who want to show concise thematic summaries for ayah groups.
1) What This Resource Is
Ayah Theme resources provide themes linked to one ayah or a range of ayahs.
Typical fields include:
-
themetext - range fields (
ayah_from,ayah_toor equivalents) - keywords/tags
- coverage counts
Primary category:
2) When to Use It
Use ayah-theme data when building:
- Passage summaries
- Theme-first study and reflection flows
- Quick contextual hints above ayah groups
3) How to Get Your First Example Resource
- Open https://qul.tarteel.ai/resources/ayah-theme.
- Keep default listing order and open the first published card.
- Confirm the detail page includes:
-
Theme Previewtab -
Helptab
-
- Confirm available download format(s) (commonly
sqlite).
This keeps onboarding concrete without hardcoded IDs.
4) What the Preview Shows (Website-Aligned)
On ayah-theme detail pages:
-
Theme Previewtab:Jump to Ayah- Theme summary for selected ayah/range
- Range coverage hints (for example multiple ayahs)
-
Helptab:- Theme field definitions
- Range logic (
ayah_fromtoayah_to)
Practical meaning:
- Theme entries can represent groups, not only single ayahs.
- You should resolve theme by range inclusion, not exact ayah equality only.
5) Download and Use (Step-by-Step)
- Download ayah-theme package (commonly
sqlite). - Import theme rows with range fields.
- Build resolver to find matching theme for selected ayah.
- Render theme text + keywords + covered range.
- Join with script/translation display context.
Starter integration snippet (JavaScript):
JavaScript
const findThemeForAyah = (themeRows, surah, ayah) =>
themeRows.find((row) =>
row.surah_number === surah && ayah >= row.ayah_from && ayah <= row.ayah_to
) || null;
6) Real-World Example: Passage Theme Banner
Goal:
- User opens an ayah and sees the current passage theme.
Inputs:
- Ayah Theme package
- Quran Script package
Processing:
- Resolve current ayah.
- Find theme row where ayah falls in range.
- Display theme banner above ayah text.
Expected output:
- Users get quick thematic context for current passage.
Interactive preview (temporary sandbox):
You can edit this code for testing. Edits are not saved and may not persist after refresh.
JavaScript Playground
Editor
Preview
7) Common Mistakes to Avoid
- Matching themes only by exact ayah instead of range.
- Ignoring multi-ayah group coverage.
- Showing stale theme when user navigates between ayahs.
8) When to Request Updates or Changes
Open an issue if you find:
- Broken range mappings
- Missing theme text/keywords
- Broken download links
Issue tracker: