Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ragaeeb/shamela/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Shamela exports several constants that are used internally and can be customized for advanced use cases.DEFAULT_MAPPING_RULES
Character mapping rules used bymapPageCharacterContent() to normalize Arabic text from Shamela sources.
Type
Description
A dictionary of regex patterns (as strings) mapped to their replacement values. These rules handle special Arabic ligatures, religious abbreviations, and formatting artifacts commonly found in Shamela texts.Common Mappings
The rules include mappings for:- Religious abbreviations: Special Unicode characters representing common Islamic phrases
﵀→رَحِمَهُ ٱللَّٰهُ(May Allah have mercy on him)﵁→رضي الله عنه(May Allah be pleased with him)﷽→بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ(Bismillah)
- Formatting artifacts: HTML image tags and special markers
Usage
Available from Export
The complete list of mappings can be found in the source code at
src/utils/constants.ts. The rules are designed to preserve the meaning while making the text more readable.DEFAULT_MASTER_METADATA_VERSION
The default version number used when checking for master database updates.Type
Description
When requesting master database metadata, this constant represents “get the latest version”. It’s used as the default parameter forgetMasterMetadata().
Usage
FOOTNOTE_MARKER
The default separator used to distinguish page body content from footnotes.Type
Description
This string marker (9 underscores) is used by Shamela to separate the main text of a page from its footnotes. ThesplitPageBodyFromFooter() function uses this constant by default.
Usage
UNKNOWN_VALUE_PLACEHOLDER
Placeholder value representing unknown or missing data in the Shamela database.Type
Description
This constant is used internally to represent missing or unknown values in author death dates and other numeric fields.Usage
Related
- mapPageCharacterContent() - Uses DEFAULT_MAPPING_RULES
- splitPageBodyFromFooter() - Uses FOOTNOTE_MARKER
- getMasterMetadata() - Uses DEFAULT_MASTER_METADATA_VERSION