Skip to content

Commit

Permalink
refactor: Update JSON generator
Browse files Browse the repository at this point in the history
  • Loading branch information
risan committed Dec 3, 2018
1 parent a442c81 commit 994517f
Show file tree
Hide file tree
Showing 261 changed files with 26,539 additions and 25,235 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: [
"airbnb-base",
"plugin:prettier/recommended"
]
};
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/node_modules
/tanzil-test
node_modules
yarn.lock
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
scripts
tanzil
.eslintrc.js
yarn.lock
90 changes: 87 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,98 @@
# Quran JSON

Quran text and translations from [tanzil.net](http://tanzil.net) in JSON format. The translations are available in English and Indonesian.
Quran text and translations in JSON format. Both Quran text and the translations are provided by [tanzil.net](http://tanzil.net).

## Related Packages
## Quran JSON CDN

Check the [json directory](https://github.com/risan/quran-json/tree/master/json) to see all available JSON files. The JSON files are also available through [UNPKG](https://unpkg.com/) CDN.

### List of Surah

* List of surah: [unpkg.com/quran-json@latest/json/surahs.json](https://unpkg.com/quran-json@latest/json/surahs.json)

### Quran Text

* Quran Text: [unpkg.com/quran-json@latest/json/quran/text.json](https://unpkg.com/quran-json@latest/json/quran/text.json)

### Translations

* English translation (Saheeh International): [unpkg.com/quran-json@latest/json/translations/en.json](https://unpkg.com/quran-json@latest/json/translations/en.json)
* Indonesian translation (Indonesian Ministry of Religious Affairs): [unpkg.com/quran-json@latest/json/translations/id.json](https://unpkg.com/quran-json@latest/json/translations/id.json)

### Quran Text with Translations

* Quran text with English translation (Saheeh International): [unpkg.com/quran-json@latest/json/quran/en.json](https://unpkg.com/quran-json@latest/json/quran/en.json)
* Quran text with Indonesian translation (Indonesian Ministry of Religious Affairs): [unpkg.com/quran-json@latest/json/quran/id.json](https://unpkg.com/quran-json@latest/json/quran/id.json)
* Quran text with English and Indonesian translations: [unpkg.com/quran-json@latest/json/quran/en-id.json](https://unpkg.com/quran-json@latest/json/quran/en-id.json)

### Quran Text with Translations per Surah

Each Surah is available under the following URL format:

```
https://unpkg.com/quran-json@latest/json/surahs/{surahNumber}.json
```

`surahNumber` is an integer from `1` (Al-Faatiha) to `144` (An-Naas). For example:

* Al-Faatiha: [unpkg.com/quran-json@latest/json/surahs/1.json](https://unpkg.com/quran-json@latest/json/surahs/1.json)
* Ar-Rahmaan: [unpkg.com/quran-json@latest/json/surahs/55.json](https://unpkg.com/quran-json@latest/json/surahs/55.json)
* Al-Aadiyaat: [unpkg.com/quran-json@latest/json/surahs/100.json](https://unpkg.com/quran-json@latest/json/surahs/100.json)

### Pretty JSON Version

All of the JSON files above are the minified version. Each one of them also has the pretty version with spacing. For example:

* List of surah: [unpkg.com/quran-json@latest/json/surahs.pretty.json](https://unpkg.com/quran-json@latest/json/surahs.pretty.json)
* Quran Text: [unpkg.com/quran-json@latest/json/quran/text.pretty.json](https://unpkg.com/quran-json@latest/json/quran/text.pretty.json)
* Quran text with English and Indonesian translations: [unpkg.com/quran-json@latest/json/quran/en-id.pretty.json](https://unpkg.com/quran-json@latest/json/quran/en-id.pretty.json)
* Al-Faatiha: [unpkg.com/quran-json@latest/json/surahs/1.pretty.json](https://unpkg.com/quran-json@latest/json/surahs/1.pretty.json)

## Generate the JSON

If you want to generate the JSON by yourself:

### 1. Clone the Repository

Clone this repository to your local computer:

```bash
$ git clone [email protected]:risan/quran-json.git
```

### 2. Install the Dependencies

`CD` into the project directory and install the dependencies:

```bash
# Go to the project directory
$ cd quran-json

# Install the dependencies
$ npm install

# Or if you use Yarn
$ yarn
```

### 3. Generate the JSON Files

Run the following command to generate the JSON files:

```bash
$ npm run build

# Or if you use Yarn
$ yarn build
```

## Related

* [tanzil-downloader](https://github.com/risan/tanzil-downloader)

## License

CC-BY-SA 4.0 · [Risan Bagja Pradana](https://risan.io)
CC-BY-SA 4.0 · [Risan Bagja Pradana](https://bagja.net)

## Legal

Expand Down
1 change: 0 additions & 1 deletion json/quran-en-id.json

This file was deleted.

1 change: 0 additions & 1 deletion json/quran-en.json

This file was deleted.

1 change: 0 additions & 1 deletion json/quran-id.json

This file was deleted.

1 change: 1 addition & 0 deletions json/quran/en-id.json

Large diffs are not rendered by default.

12,472 changes: 6,236 additions & 6,236 deletions json/quran-en-id-pretty.json → json/quran/en-id.pretty.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions json/quran/en.json

Large diffs are not rendered by default.

12,472 changes: 6,236 additions & 6,236 deletions json/quran-en-pretty.json → json/quran/en.pretty.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions json/quran/id.json

Large diffs are not rendered by default.

12,472 changes: 6,236 additions & 6,236 deletions json/quran-id-pretty.json → json/quran/id.pretty.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion json/surahs/1.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"number":1,"name":"سورة الفاتحة","transliteration_en":"Al-Faatiha","translation_en":"The Opening","total_verses":7,"revelation_type":"Meccan","verses":[{"number":1,"content":"بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ","translation_en":"In the name of Allah, the Entirely Merciful, the Especially Merciful.","translation_id":"Dengan menyebut nama Allah Yang Maha Pemurah lagi Maha Penyayang."},{"number":2,"content":"ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ","translation_en":"[All] praise is [due] to Allah, Lord of the worlds -","translation_id":"Segala puji bagi Allah, Tuhan semesta alam."},{"number":3,"content":"ٱلرَّحْمَٰنِ ٱلرَّحِيمِ","translation_en":"The Entirely Merciful, the Especially Merciful,","translation_id":"Maha Pemurah lagi Maha Penyayang."},{"number":4,"content":"مَٰلِكِ يَوْمِ ٱلدِّينِ","translation_en":"Sovereign of the Day of Recompense.","translation_id":"Yang menguasai di Hari Pembalasan."},{"number":5,"content":"إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ","translation_en":"It is You we worship and You we ask for help.","translation_id":"Hanya Engkaulah yang kami sembah, dan hanya kepada Engkaulah kami meminta pertolongan."},{"number":6,"content":"ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ","translation_en":"Guide us to the straight path -","translation_id":"Tunjukilah kami jalan yang lurus,"},{"number":7,"content":"صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ","translation_en":"The path of those upon whom You have bestowed favor, not of those who have evoked [Your] anger or of those who are astray.","translation_id":"(yaitu) Jalan orang-orang yang telah Engkau beri nikmat kepada mereka; bukan (jalan) mereka yang dimurkai dan bukan (pula jalan) mereka yang sesat."}]}
{"number":1,"name":"سورة الفاتحة","transliteration_en":"Al-Faatiha","translation_en":"The Opening","total_verses":7,"revelation_type":"Meccan","verses":[{"number":1,"text":"بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ","translation_en":"In the name of Allah, the Entirely Merciful, the Especially Merciful.","translation_id":"Dengan menyebut nama Allah Yang Maha Pemurah lagi Maha Penyayang."},{"number":2,"text":"ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ","translation_en":"[All] praise is [due] to Allah, Lord of the worlds -","translation_id":"Segala puji bagi Allah, Tuhan semesta alam."},{"number":3,"text":"ٱلرَّحْمَٰنِ ٱلرَّحِيمِ","translation_en":"The Entirely Merciful, the Especially Merciful,","translation_id":"Maha Pemurah lagi Maha Penyayang."},{"number":4,"text":"مَٰلِكِ يَوْمِ ٱلدِّينِ","translation_en":"Sovereign of the Day of Recompense.","translation_id":"Yang menguasai di Hari Pembalasan."},{"number":5,"text":"إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ","translation_en":"It is You we worship and You we ask for help.","translation_id":"Hanya Engkaulah yang kami sembah, dan hanya kepada Engkaulah kami meminta pertolongan."},{"number":6,"text":"ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ","translation_en":"Guide us to the straight path -","translation_id":"Tunjukilah kami jalan yang lurus,"},{"number":7,"text":"صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ","translation_en":"The path of those upon whom You have bestowed favor, not of those who have evoked [Your] anger or of those who are astray.","translation_id":"(yaitu) Jalan orang-orang yang telah Engkau beri nikmat kepada mereka; bukan (jalan) mereka yang dimurkai dan bukan (pula jalan) mereka yang sesat."}]}
14 changes: 7 additions & 7 deletions json/surahs-pretty/1.json → json/surahs/1.pretty.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@
"verses": [
{
"number": 1,
"content": "بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ",
"text": "بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ",
"translation_en": "In the name of Allah, the Entirely Merciful, the Especially Merciful.",
"translation_id": "Dengan menyebut nama Allah Yang Maha Pemurah lagi Maha Penyayang."
},
{
"number": 2,
"content": "ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ",
"text": "ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ",
"translation_en": "[All] praise is [due] to Allah, Lord of the worlds -",
"translation_id": "Segala puji bagi Allah, Tuhan semesta alam."
},
{
"number": 3,
"content": "ٱلرَّحْمَٰنِ ٱلرَّحِيمِ",
"text": "ٱلرَّحْمَٰنِ ٱلرَّحِيمِ",
"translation_en": "The Entirely Merciful, the Especially Merciful,",
"translation_id": "Maha Pemurah lagi Maha Penyayang."
},
{
"number": 4,
"content": "مَٰلِكِ يَوْمِ ٱلدِّينِ",
"text": "مَٰلِكِ يَوْمِ ٱلدِّينِ",
"translation_en": "Sovereign of the Day of Recompense.",
"translation_id": "Yang menguasai di Hari Pembalasan."
},
{
"number": 5,
"content": "إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ",
"text": "إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ",
"translation_en": "It is You we worship and You we ask for help.",
"translation_id": "Hanya Engkaulah yang kami sembah, dan hanya kepada Engkaulah kami meminta pertolongan."
},
{
"number": 6,
"content": "ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ",
"text": "ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ",
"translation_en": "Guide us to the straight path -",
"translation_id": "Tunjukilah kami jalan yang lurus,"
},
{
"number": 7,
"content": "صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ",
"text": "صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ",
"translation_en": "The path of those upon whom You have bestowed favor, not of those who have evoked [Your] anger or of those who are astray.",
"translation_id": "(yaitu) Jalan orang-orang yang telah Engkau beri nikmat kepada mereka; bukan (jalan) mereka yang dimurkai dan bukan (pula jalan) mereka yang sesat."
}
Expand Down
2 changes: 1 addition & 1 deletion json/surahs/10.json

Large diffs are not rendered by default.

Loading

0 comments on commit 994517f

Please sign in to comment.