The Majlis Archive

How this site runs

In short

  • This archive is an index of everything The Majlis have published: their questions and answers, articles, books, newsletters, Al-Haq Bulletin and Awake!. Every item links to its source and its PDF.
  • AI is used here in two limited ways: sorting answers into The Majlis's own categories, and search by meaning. It does not write any of the text.
  • A team of Ulama and Tulaba will check each and every answer by hand.

This archive

The Majlis write and publish on their own WordPress site, themajlis.co.za. Twice a day an automatic program brings in what they have newly published, rebuilds this archive, checks it and publishes it. It does not change their WordPress site and installs nothing on it.

The Majlis's spelling is never changed. Their own 21 categories are the only categories used.

How the text was taken out of the PDFs

Where a PDF already contains its text, the text was read straight out of the file. Where a page is a scanned picture, the text was read using ordinary text recognition, the same kind a phone uses to read text in a photo. Fixed rules then divided each page into separate questions and answers. Each answer was checked word for word against the PDF. Where text could not be confirmed as exact, the archive shows the PDF itself and uses the text only to help search find it.

Text read by a program can, rarely, misread a word. That is why every answer links to its printed page, and answers that may differ from it carry a warning. It is also why a team of Ulama and Tulaba will check each and every one of the more than 9,000 answers by hand, reading it against the printed page before approving it.

Where AI is used

  1. Sorting. Most of the questions and answers were sorted into The Majlis's own categories by an AI model. The rest were sorted by fixed rules or follow The Majlis's own filing. No new categories were made. A wrong category only puts an answer on the wrong shelf. It does not change the answer's words.
  2. Search by meaning. Next to ordinary word search, the archive can also find passages that mean the same as your search, even when the words differ. It can only find and order passages that already exist. It does not write anything.

Corrections are made by people. Suggested corrections are approved by a person before they are applied.

Search

Word search works like the index at the back of a book. When the site is built, a list is made of every word on every page. When you search, your own browser looks your words up in that list and shows the pages that contain them. Search by meaning, described above, sits beside it. Neither writes, summarises or answers.

Who decides what changes

The program code behind this site was written with the help of an AI coding assistant. It writes the code, the way a calculator helps with sums. It is not part of the site, does not run it and does not publish anything. Every change to the design is made because a person asked for it. The writings themselves are changed only by The Majlis, on their own WordPress site.

Technical details

For anyone who wants the full picture.

This archive

Source of content
The Majlis's WordPress site, read through its public REST API (/wp-json/wp/v2/), read only, together with the PDFs and other files their posts link to. No plugin, account or code is added to their WordPress.
Schedule
A scheduled job runs twice a day. It fetches new and edited posts and their files, extracts and checks them, rebuilds the site and publishes it. Anything that needs a person's decision is held back until it has one.
Text from PDFs
Text layers are read with pdfplumber and checked against Poppler's pdftotext, a separate implementation. Scanned pages are read with Apple's Vision text recognition, with Tesseract as an alternative. Questions and answers are separated by rule-based parsers. Each record is verified against its PDF by comparing the words, and records whether its text is exact. Text that is not confirmed exact is used for search only, and the PDF is shown instead.
Categories
The Majlis's own 21 subject categories. Each record notes how it was filed: from The Majlis's own site, by a fixed rule, by a person, or by an AI model.
Build
Astro, a static site generator, renders every page to a plain HTML file.
Hosting
Cloudflare Pages, which serves the static files from Cloudflare's network. A few Cloudflare Pages Functions handle what static files cannot, such as the Contact form and reader feedback, which are stored in a Cloudflare D1 database.
Word search
Pagefind, a static search index built from the finished pages. The search itself runs in the reader's browser, which downloads only the parts of the index it needs.
Search by meaning
An embedding model (bge-small-en-v1.5, run on Cloudflare Workers AI). Each passage is turned into a list of numbers when the site is built; a search is turned into numbers the same way, and the closest passages are returned. The model returns passages that exist. It produces no text.
Corrections
Suggested corrections are kept in a Cloudflare D1 database and applied only after a person approves them.