Open maeyler opened 1 year ago
Problem: extract several verses from a given chapter, with the root of each word in data tag
data
Solution: https://github.com/Okuyun/Kitap/blob/main/ders/huruf.html
// c: chapter [1-114], n: number of verses chapToHTML = (c,n) => { let i = indexOf(c,1) let s = Q.qur.data.slice(i,i+n).map(verseToHTML).join('*\n') console.log(header(c)+s+'<br>\n') } header = c => ` <tr> <td> <a class=sure href="/Kuran/reader.html#v=${c}:1" target="iqra">${c} ${suraNames.tr[c]}</a> <span data="harf"></span> <td class=ayet> <a class=sure href="/Kuran/reader.html#v=${c}:1" target="iqra">${suraNames.ar[c]}</a> <span data="harf"></span> ` verseToHTML = s => s.split(' ').slice(1).map(wordToHTML).join(' ') wordToHTML = x => { let r = Q.roots.wordToRoot(toBuckwalter(x)); return r? '<span data='+r+'>'+x+'</span>': x }
This is not a real issue -- just a litlle note to myself
I need this snippet often, that's why I placed in an issue
Problem: extract several verses from a given chapter, with the root of each word in
data
tagSolution: https://github.com/Okuyun/Kitap/blob/main/ders/huruf.html