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:

  • theme text
  • range fields (ayah_from, ayah_to or 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

  1. Open https://qul.tarteel.ai/resources/ayah-theme.
  2. Keep default listing order and open the first published card.
  3. Confirm the detail page includes:
    • Theme Preview tab
    • Help tab
  4. 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 Preview tab:
    • Jump to Ayah
    • Theme summary for selected ayah/range
    • Range coverage hints (for example multiple ayahs)
  • Help tab:
    • Theme field definitions
    • Range logic (ayah_from to ayah_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)

  1. Download ayah-theme package (commonly sqlite).
  2. Import theme rows with range fields.
  3. Build resolver to find matching theme for selected ayah.
  4. Render theme text + keywords + covered range.
  5. 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:

  1. Resolve current ayah.
  2. Find theme row where ayah falls in range.
  3. 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:

Related Docs