Divan text: the source link field is ماخذ_لنک (was ماخذ_ربط), in the converter, the editor's suggested fields, the guide and the examples

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Anas Rashid 2026-10-09 18:10:51 +02:00
parent bc51aa66ab
commit c1cf7c01a8
7 changed files with 7 additions and 5 deletions

1
api/node_modules Symbolic link
View File

@ -0,0 +1 @@
/Users/anasrashid/divan/api/node_modules

View File

@ -13,7 +13,7 @@ type Verse = { Position: string; Text: string; CoupletIndex: number };
// a work (ganjoor-data poem JSON) as Divan text: verse in <poem> (blank line between couplets, stanzas and // a work (ganjoor-data poem JSON) as Divan text: verse in <poem> (blank line between couplets, stanzas and
// lines), prose as paragraphs // lines), prose as paragraphs
export function fromPoem(poem: { Title: string; Verses: Verse[]; SourceUrl?: string }, meta: Record<string, string> = {}) { export function fromPoem(poem: { Title: string; Verses: Verse[]; SourceUrl?: string }, meta: Record<string, string> = {}) {
const head = Object.entries({ عنوان: poem.Title, ...meta, ...(poem.SourceUrl && { ماخذ: 'ویکی ماخذ', ماخذ_ربط: poem.SourceUrl }) }) const head = Object.entries({ عنوان: poem.Title, ...meta, ...(poem.SourceUrl && { ماخذ: 'ویکی ماخذ', ماخذ_لنک: poem.SourceUrl }) })
.map(([k, v]) => `| ${k} = ${v}`).join('\n'); .map(([k, v]) => `| ${k} = ${v}`).join('\n');
const units = new Map<number, Verse[]>(); const units = new Map<number, Verse[]>();
for (const v of poem.Verses) (units.get(v.CoupletIndex) ?? units.set(v.CoupletIndex, []).get(v.CoupletIndex)!).push(v); for (const v of poem.Verses) (units.get(v.CoupletIndex) ?? units.set(v.CoupletIndex, []).get(v.CoupletIndex)!).push(v);

View File

@ -4,7 +4,7 @@
| صنف = غزل | صنف = غزل
| ردیف = ہوتا | ردیف = ہوتا
| ماخذ = ویکی ماخذ | ماخذ = ویکی ماخذ
| ماخذ_ربط = https://ur.wikisource.org/wiki/%DB%8C%DB%81_%D9%86%DB%81_%D8%AA%DA%BE%DB%8C_%DB%81%D9%85%D8%A7%D8%B1%DB%8C_%D9%82%D8%B3%D9%85%D8%AA_%DA%A9%DB%81_%D9%88%D8%B5%D8%A7%D9%84_%DB%8C%D8%A7%D8%B1_%DB%81%D9%88%D8%AA%D8%A7 | ماخذ_لنک = https://ur.wikisource.org/wiki/%DB%8C%DB%81_%D9%86%DB%81_%D8%AA%DA%BE%DB%8C_%DB%81%D9%85%D8%A7%D8%B1%DB%8C_%D9%82%D8%B3%D9%85%D8%AA_%DA%A9%DB%81_%D9%88%D8%B5%D8%A7%D9%84_%DB%8C%D8%A7%D8%B1_%DB%81%D9%88%D8%AA%D8%A7
}} }}
<poem> <poem>
{{مطلع}} یہ نہ تھی ہماری قسمت کہ [[وصال]] یار ہوتا {{مطلع}} یہ نہ تھی ہماری قسمت کہ [[وصال]] یار ہوتا

View File

@ -3,7 +3,7 @@
| مصنف = سید احمد خان | مصنف = سید احمد خان
| صنف = مضمون | صنف = مضمون
| ماخذ = ویکی ماخذ | ماخذ = ویکی ماخذ
| ماخذ_ربط = https://ur.wikisource.org/wiki/%D8%A2%D8%B2%D8%A7%D8%AF%DB%8C_%D8%B1%D8%A7%D8%A6%DB%92 | ماخذ_لنک = https://ur.wikisource.org/wiki/%D8%A2%D8%B2%D8%A7%D8%AF%DB%8C_%D8%B1%D8%A7%D8%A6%DB%92
}} }}
== آزادی رائے == == آزادی رائے ==

1
web/node_modules Symbolic link
View File

@ -0,0 +1 @@
/Users/anasrashid/divan/web/node_modules

View File

@ -13,7 +13,7 @@ const ex = {
| ردیف = یاد ہے | ردیف = یاد ہے
| قافیہ = بہانا، زمانا | قافیہ = بہانا، زمانا
| ماخذ = ویکی ماخذ | ماخذ = ویکی ماخذ
| ماخذ_ربط = https://ur.wikisource.org/… | ماخذ_لنک = https://ur.wikisource.org/…
}}`, }}`,
ghazal: `<poem> ghazal: `<poem>
چپکے چپکے رات دن آنسو بہانا یاد ہے چپکے چپکے رات دن آنسو بہانا یاد ہے

View File

@ -270,7 +270,7 @@ import Icon from '../../../components/Icon.astro';
if (host && source) { if (host && source) {
const { editor, meta } = createEditor(host, source.value); const { editor, meta } = createEditor(host, source.value);
const rows = document.getElementById('meta-rows')!; const rows = document.getElementById('meta-rows')!;
const KNOWN = ['عنوان', 'شاعر', 'مصنف', 'صنف', 'ردیف', 'قافیہ', 'بحر', 'ماخذ', 'ماخذ_ربط']; const KNOWN = ['عنوان', 'شاعر', 'مصنف', 'صنف', 'ردیف', 'قافیہ', 'بحر', 'ماخذ', 'ماخذ_لنک'];
const row = (k = '', v = '') => { const row = (k = '', v = '') => {
const r = document.createElement('div'); r.className = 'meta-row'; const r = document.createElement('div'); r.className = 'meta-row';
r.innerHTML = '<input class="meta-k" list="meta-keys" aria-label="معلومات کا نام"><input class="meta-v" data-urdu aria-label="قدر"><button type="button" class="tool" title="ہٹائیں" aria-label="ہٹائیں"><svg class="icon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>'; r.innerHTML = '<input class="meta-k" list="meta-keys" aria-label="معلومات کا نام"><input class="meta-v" data-urdu aria-label="قدر"><button type="button" class="tool" title="ہٹائیں" aria-label="ہٹائیں"><svg class="icon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>';