{"id":23427244,"url":"https://github.com/arrayiterator/json-dhikr","last_synced_at":"2025-04-09T12:24:17.491Z","repository":{"id":158658587,"uuid":"287505458","full_name":"ArrayIterator/json-dhikr","owner":"ArrayIterator","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-21T08:51:49.000Z","size":279,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T06:30:39.153Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArrayIterator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-14T10:19:45.000Z","updated_at":"2020-08-21T08:51:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1ec7377-938f-4893-9e5a-846a342d2352","html_url":"https://github.com/ArrayIterator/json-dhikr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fjson-dhikr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fjson-dhikr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fjson-dhikr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fjson-dhikr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArrayIterator","download_url":"https://codeload.github.com/ArrayIterator/json-dhikr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248037690,"owners_count":21037394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T06:17:48.022Z","updated_at":"2025-04-09T12:24:17.486Z","avatar_url":"https://github.com/ArrayIterator.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## DOA\n\n### STRUCTURES\n```json\n[\n  {\n    \"title_en\": \"(string) title on english (en) as identifier\",\n    \"title_id\": \"(string) title on indonesian (id) as identifier\",\n    \"type\": \"(string) data type purpose for (note|dua)\",\n    \"pre_contents\": [\n        {\n            \"pre_text_id\": \"(string|null) string if there are content otherwise null of pre text before text (arabic)\",\n            \"post_text_id\": \"(string|null) string if there are content otherwise null of pre text after inline_post_translation_(id) / end of text\",\n            \"text\": \"(string|null) string arabic text otherwise null\",\n            \"translation_id\": \"(string|null) translation or notes, id as identifier. (add double quote to text)\",\n            \"inline_pre_translation_id\": \"(string|null) string or null, put in-line (one line) before translation start\",\n            \"inline_post_translation_id\": \"(string|null) string or null, put in-line (one line) after translation end\"\n        }\n    ],\n    \"contents\": [\n      {\n        \"pre_text_id\": \"(string|null) string if there are content otherwise null of pre text before text (arabic)\",\n        \"post_text_id\": \"(string|null) string if there are content otherwise null of pre text after inline_post_translation_(id) / end of text\",\n        \"text\": \"(string|null) string arabic text otherwise null\",\n        \"translation_id\": \"(string|null) translation or notes, id as identifier. (add double quote to text)\",\n        \"inline_pre_translation_id\": \"(string|null) string or null, put in-line (one line) before translation start\",\n        \"inline_post_translation_id\": \"(string|null) string or null, put in-line (one line) after translation end\"\n      }  \n    ]\n  }\n]\n\n```\n\n### SAMPLE\n\nif there are new lines on contents value of string, please add it as list. (ul/li) \n\n```javascript\n\n// object doa\nvar doa = [{}];\n\nfunction convertTo(data, tag, isRTL, attr)\n{\n    if (!data) {\n        return '';\n    }\n    tag = tag ? tag : 'div';\n    attr = attr \u0026\u0026 typeof attr === 'string' ? attr : '';\n    attr = attr.trim();\n    var html = isRTL ? '\u003c'+tag+' dir=\"rtl\" '+attr+'\u003e' : '\u003cdiv\u003e';\n        if (data.match(/[\\n]/)) {\n            var new_data = data.split(\"\\n\");\n            html += \"\u003cul\u003e\";\n            for (i = 0;new_data.length \u003e i;i++) {\n                html += \"\u003cli\u003e\"+new_data[i]+\"\u003c/li\u003e\";    \n            }\n            html += \"\u003c/ul\u003e\";\n        } else {\n            html += data;\n        }\n    html += '\u003c/'+tag+'\u003e';\n    return html; \n}\n\nvar allHtmls = [];\nfor (var rootKey in doa) {\n    if (!doa.hasOwnProperty(rootKey)) {\n        continue;\n    }\n    var currentDoa = doa[rootKey];\n    if (typeof currentDoa['contents'] === 'undefined' \n        || !currentDoa['contents']\n        || currentDoa['contents'] !== 'object'\n        || !currentDoa['contents'].length\n    ) {\n        continue;\n    }\n\n    var title = currentDoa['title_id']||null;\n    if (!title_id) {\n        continue;\n    }\n    var html = '\u003ch2\u003e'+title+'\u003c/h2\u003e'; \n    var currentContents = currentDoa['contents'];\n    html += '\u003cdiv class=\"content-section\"\u003e';\n    for (var i=0; currentContents.length \u003e i;i++) {\n        var current = currentContents[i];\n        var pre = current['pre_text_id'];\n        var post = current['post_text_id'];\n        var text = current['text'];\n        var trans = current['translation_id'];\n        var inline_pre = current['inline_pre_translation_id'];\n        var inline_post = current['inline_post_translation_id'];\n        if (pre) {\n            // pre is paragraf\n            html += convertTo(pre, 'p', false, 'class=\"pre-text\"');\n        }\n        if (text) {\n            // text is div cause it was arabian\n            html += convertTo(pre, 'div', true, 'class=\"arabian-text rtl\"');\n        }\n        var currentTrans = '';\n        if (inline_pre) {\n            // put pre of translation use span\n            currentTrans += convertTo(inline_pre, 'span', false, 'class=\"pre-trans\"') + ' '; // add 1 space\n        }\n        if (trans) {\n              currentTrans += '\u003cem\u003e\"'+ convertTo(trans, 'span', false, 'class=\"trans\"') +'\"\u003c/em\u003e'; // add double quotes  \n        }\n        if (inline_post) {\n            // put post of translation\n            currentTrans += ' ' + convertTo(inline_post, 'span', false, 'class=\"post-trans\"') + ' '; // add 1 space before\n        }\n        if (currentTrans !== '') {\n            // if is on trans\n            html += convertTo(pre, 'p', false, 'class=\"translation-info\"');\n        }\n        if (post) {\n            // post is paragraf\n            html += convertTo(pre, 'p', false, 'class=\"post-text\"');\n        }\n    }\n\n    html+= '\u003c/div\u003e';\n    allHtmls.push(html);\n}\n\n// console.log(allHtmls);\n\n\n```\n\n### DESCRIPTION OF DOA LIST KEYS\n\n\u003e `title_`(string|iso code: en|id) : important\n\nTitle in display mode, and must be show as heading text\n\n\u003e `contents` (array|list of doa: array[]) : important\n\nList of doa on sections of title.\n\n\u003e Sample Structure:\n\n```html\n\u003cdiv class=\"section-dua\"\u003e\n    \u003ch1 class=\"title dua-title\"\u003e{title_id}\u003c/h1\u003e\n    \u003cdiv class=\"dua-container\"\u003e\n        \u003c!-- pre content --\u003e\n\n        \u003c!-- LOOP PRE CONTENT LOOP--\u003e\n        \u003cdiv class=\"dua-pre-content-container\"\u003e\n            \u003c!-- if ({pre_contents.pre_text_id} not empty): --\u003e\n            \u003cp dir=\"ltr\"\u003e{pre_contents.pre_text_id}\u003c/p\u003e\n            \u003c!-- endif; // {pre_contents.pre_text_id} not empty --\u003e\n    \n            \u003c!-- if ({pre_contents.text} not empty): --\u003e\n            \u003cp dir=\"rtl\" class=\"arabic-text\"\u003e{pre_contents.text}\u003c/p\u003e\n            \u003c!-- endif; // {pre_contents.text} not empty --\u003e\n    \n            \u003c!-- if ({pre_contents.inline_pre_translation_id}|{pre_contents.translation_id}|{pre_contents.inline_post_translation_id} not empty): --\u003e\n            \u003cp dir=\"ltr\" class=\"translation\"\u003e\n                {pre_contents.inline_pre_translation_id}\n                {pre_contents.translation_id}\n                {pre_contents.inline_post_translation_id}\n            \u003c/p\u003e\n            \u003c!-- endif; // {pre_contents.inline_pre_translation_id}|{pre_contents.translation_id}|{pre_contents.inline_post_translation_id} not empty --\u003e\n    \n            \u003c!-- if ({pre_contents.post_text_id} not empty): --\u003e\n            \u003cp dir=\"ltr\"\u003e{pre_contents.post_text_id}\u003c/p\u003e\n            \u003c!-- endif; // {pre_contents.post_text_id} not empty --\u003e\n        \u003c/div\u003e\n\n        \u003c!-- LOOP PRE CONTENT LOOP--\u003e\n        \u003cdiv class=\"dua-content-container\"\u003e\n            \u003c!-- if ({contents.pre_text_id} not empty): --\u003e\n            \u003cp dir=\"ltr\"\u003e{contents.pre_text_id}\u003c/p\u003e\n            \u003c!-- endif; // {contents.pre_text_id} not empty --\u003e\n    \n            \u003c!-- if ({contents.text} not empty): --\u003e\n            \u003cp dir=\"rtl\" class=\"arabic-text\"\u003e{contents.text}\u003c/p\u003e\n            \u003c!-- endif; // {contents.text} not empty --\u003e\n    \n            \u003c!-- if ({contents.inline_pre_translation_id}|{contents.translation_id}|{contents.inline_post_translation_id} not empty): --\u003e\n            \u003cp dir=\"ltr\" class=\"translation\"\u003e\n                {contents.inline_pre_translation_id}\n                {contents.translation_id}\n                {contents.inline_post_translation_id}\n            \u003c/p\u003e\n            \u003c!-- endif; // {contents.inline_pre_translation_id}|{contents.translation_id}|{contents.inline_post_translation_id} not empty --\u003e\n    \n            \u003c!-- if ({contents.post_text_id} not empty): --\u003e\n            \u003cp dir=\"ltr\"\u003e{contents.post_text_id}\u003c/p\u003e\n            \u003c!-- endif; // {contents.post_text_id} not empty --\u003e\n        \u003c/div\u003e\n        \u003c!-- END LOOP --\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\n\n## MANASIK\n\nNo `inline_pre_translation_id` \u0026 `inline_post_translation_id`\n\n\n### STRUCTURES\n```json\n[\n  {\n    \"title_en\": \"(string) title on english (en) as identifier\",\n    \"title_id\": \"(string) title on indonesian (id) as identifier\",\n    \"type\": \"(string) data type purpose for (section)\",\n    \"pre_contents\": [\n        {\n            \"pre_text_id\": \"(string|null) string if there are content otherwise null of pre text before text (arabic)\",\n            \"post_text_id\": \"(string|null) string if there are content otherwise null end of text\",\n            \"text\": \"(string|null) string arabic text otherwise null\",\n            \"translation_id\": \"(string|null) translation or notes, id as identifier. (add double quote to text)\"\n        }\n    ],\n    \"contents\": [\n      {\n        \"pre_text_id\": \"(string|null) string if there are content otherwise null of pre text before text (arabic)\",\n        \"post_text_id\": \"(string|null) string if there are content otherwise null end of text\",\n        \"text\": \"(string|null) string arabic text otherwise null\",\n        \"translation_id\": \"(string|null) translation or notes, id as identifier. (add double quote to text)\"\n      }\n    ],\n    \"section\": [\n      [\n        {\n          \"title_id\": \"(string) title on indonesian (id) as identifier\",\n          \"type\": \"(string) data type purpose for (list|note)\",\n          \"pre_text_id\": \"(string|null) string if there are content otherwise null of pre text before text (arabic)\",\n          \"post_text_id\": \"(string|null) string if there are content otherwise null end of text\",\n          \"text\": \"(string|null) string arabic text otherwise null\",\n          \"translation_id\": \"(string|null) translation or notes, id as identifier. (add double quote to text)\",\n          \"pre_contents\": [\"See @pre_contents\"],\n          \"contents\": [\"see @contents\"],\n          \"list\":[\n            {\n              \"pre_text_id\": \"(string|null) string if there are content otherwise null of pre text before text (arabic)\",\n              \"post_text_id\": \"(string|null) string if there are content otherwise null end of text\",\n              \"text\": \"(string|null) string arabic text otherwise null\",\n              \"translation_id\": \"(string|null) translation or notes, id as identifier. (add double quote to text)\",\n              \"type\": \"(string) data type purpose for (sublist|note) `note` key as a `contents`\",\n              \"sublist\": [\n                \"*@inheritance type(note|list)\"\n              ],\n              \"pre_contents\": [],\n              \"contents\": []\n            }\n          ]\n        }\n      ]\n    ]\n  }\n]\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrayiterator%2Fjson-dhikr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrayiterator%2Fjson-dhikr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrayiterator%2Fjson-dhikr/lists"}