islamic-network/qalam 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

islamic-network/qalam

Composer 安装命令:

composer require islamic-network/qalam

包简介

Content wrappers for the Islamic Network ilm CMS: Markdown + language normalization, translation-row pivoting, diacritic folding, and API envelope conventions.

README 文档

README

Content wrappers for the Islamic Network ilm CMS: the shared layer between Directus and the public Kipchak APIs (pray, events, people). Included as a Composer package by the APIs and the Islamic Network SDK.

Everything the API contracts promise that Directus doesn't do lives here:

ComponentJob
Markdown\RendererCMS Markdown → HTML (CommonMark; inline HTML allowed, unsafe links not)
Markdown\BracketSpansThe authoring convention […]{.translit} / […]{lang=ur} → spans
Html\LanguageNormalizerWraps untagged Arabic runs in <span lang="ar">; promotes all-Arabic blocks to <p lang="ar" dir="rtl">; honorific ligatures (ﷺ) flow inline
Text\ProseA prose field as served: {raw: <markdown>, html: <rendered+normalized>}
Directus\TranslationsPivots *_translations rows into {ar, ar-Latn, en, …} objects (BCP 47 keys, canonical order, empties omitted)
Text\DiacriticFolderSearch folding: tasbih matches Ṣalāt al-Tasbīḥ and تَسْبِيح
Content\TimesThe times-of-day contract enum → {key, label} pairs
Api\Pagination?page/?limit parsing + the meta block ({total, page, limit, pages})

The response envelope ({code, status, data}) is not here — Kipchak owns it.

Requirements

PHP 8.4+ (uses the new Dom\HTMLDocument API), ext-dom, ext-intl, ext-mbstring.

Tests are the contract

tests/fixtures/ holds copies of the locked API samples from ../api/. The pipeline tests assert that rendering each sample's raw produces its html byte-for-byte (modulo inter-tag whitespace) — if a convention changes, change the sample first and the tests say what code must follow.

composer install
composer test

Usage sketch

use IslamicNetwork\Qalam\Directus\Translations;
use IslamicNetwork\Qalam\Text\Prose;
use IslamicNetwork\Qalam\Content\Times;

$t = new Translations($directusRow['translations']);

$record = [
    'name'         => $t->text('name'),          // {ar, ar-Latn, en}
    'description'  => $t->prose('description'),  // {en: {raw, html}}
    'translations' => $t->text('translation'),   // {ar-Latn, en, ur, …}
    'times'        => Times::toApi($junction['times']),
];

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固