Skip to content

Commit

Permalink
docs: update qdc docs url & add missing docs for new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedriad1 committed Jan 7, 2025
1 parent b464275 commit efd77f9
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 47 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ you can visit the [docs][docs] for more details.

<!-- Links -->

[qdc-api]: https://api-docs.quran.com/docs/category/quran.com-api
[qdc-api]: https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/quran-com-api
[docs]: https://quranjs.vercel.app/
[build-badge]: https://github.com/quran/api-js/workflows/CI/badge.svg
[build]: https://github.com/quran/api-js/actions?query=workflow%3ACI
Expand Down
16 changes: 8 additions & 8 deletions docs/src/pages/audio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Get all chapter recitations for specific reciter.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/list-of-all-surah-audio-files-for-specific-reciter)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/chapter-reciter-audio-files)

**Params:**

Expand All @@ -23,7 +23,7 @@ quran.v4.audio.findAllChapterRecitations('2'); // abdulbaset abdulsamad

Get chapter recitation for specific reciter and a specific chapter.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/get-single-surah-audio-for-specific-reciter)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/chapter-reciter-audio-file)

**Params:**

Expand All @@ -45,7 +45,7 @@ quran.v4.audio.findChapterRecitationById('1', '2'); // first chapter recitation

Get all verse audio files for a specific reciter and a specific chapter.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-surah)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-surah-recitation)

**Params:**

Expand All @@ -67,7 +67,7 @@ quran.v4.audio.findVerseRecitationsByChapter('1', '2');

Get all verse audio files for a specific reciter and a specific hizb.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-hizb)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-hizb-recitaiton)

**Params:**

Expand All @@ -89,7 +89,7 @@ quran.v4.audio.findVerseRecitationsByHizb('1', '2');

Get all verse audio files for a specific reciter and a specific juz.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-juz)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-juz-recitaiton)

**Params:**

Expand All @@ -111,7 +111,7 @@ quran.v4.audio.findVerseRecitationsByJuz('1', '2');

Get all verse audio files for a specific reciter and a specific verse.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-ayah)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-ayah-recitaiton)

**Params:**

Expand All @@ -133,7 +133,7 @@ quran.v4.audio.findVerseRecitationsByKey('1:1', '2');

Get all verse audio files for a specific reciter and a specific mushaf page.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-madani-mushaf-page)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-page-recitaiton)

**Params:**

Expand All @@ -155,7 +155,7 @@ quran.v4.audio.findVerseRecitationsByPage('1', '2');

Get all verse audio files for a specific reciter and a specific rub.

- [Quran.com API Docs](https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-rub)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-rub-el-hizb-recitaiton)

**Params:**

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/chapters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Get all chapters.

- [Quran.api API Docs](https://quran.api-docs.io/v4/chapters/list-chapters)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-chapters)

**Params:**

Expand All @@ -22,7 +22,7 @@ quran.v4.chapters.findAll();

Get chapter by id.

- [Quran.com API Docs](https://quran.api-docs.io/v4/chapters/get-chapter)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter)

**Params:**

Expand All @@ -44,7 +44,7 @@ quran.v4.chapters.findById('114');

Get chapter info by id.

- [Quran.com API Docs](https://quran.api-docs.io/v4/chapters/chapter_info)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/info)

**Params:**

Expand Down
19 changes: 17 additions & 2 deletions docs/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ import { Tab, Tabs } from 'nextra-theme-docs';

<Image src="/banner.png" alt="QuranJS/API Banner" width={1280} height={680} />

A library for fetching quran data from the [Quran.com API](https://quran.api-docs.io/). This library also works on both Node.js and the browser.
A library for fetching quran data from the [Quran.com API](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/quran-com-api). This library also works on both Node.js and the browser.

- [NPM](https://www.npmjs.com/package/@quranjs/api)
- [MIT License](https://github.com/quran/api-js/blob/master/LICENSE)

## Installation

{/* prettier-ignore-start */}
<Tabs items={['npm', 'yarn']}>
<Tabs items={['pnpm', 'npm', 'yarn','CDN']}>
<Tab>
```bash
pnpm add @quranjs/api
```
</Tab>
<Tab>
```bash
npm install @quranjs/api
Expand All @@ -22,6 +27,16 @@ A library for fetching quran data from the [Quran.com API](https://quran.api-doc
yarn add @quranjs/api
```
</Tab>
<Tab>
```html
<script src="https://unpkg.com/@quranjs/api/dist/index.umd.min.js"></script>
<script>
// quranjsApi is the global variable set by the script tag
const { quran } = window.quranjsApi;
quran.v4.chapters.findAll().then(console.log); // log all chapters
</script>
```
</Tab>
</Tabs>
{/* prettier-ignore-end */}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/juzs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Get All Juzs

- [Quran.com API Docs](https://quran.api-docs.io/v4/juz/get-all-juzs)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/juzs)

**Example:**

Expand Down
79 changes: 71 additions & 8 deletions docs/src/pages/resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Get all chapter infos.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/chapter-info)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/chapter-info)

**Params:**

Expand All @@ -22,7 +22,7 @@ quran.v4.resources.findAllChapterInfos();

Get all chapter reciters.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/list-of-chapter-reciters)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/chapter-reciters)

**Params:**

Expand All @@ -42,7 +42,7 @@ quran.v4.resources.findAllChapterReciters();

Get all languages.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/languages)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/languages)

**Params:**

Expand All @@ -62,7 +62,7 @@ quran.v4.resources.findAllLanguages();

Get all recitations.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/recitations)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/recitations)

**Params:**

Expand All @@ -78,11 +78,32 @@ Get all recitations.
quran.v4.resources.findAllRecitations();
```

## findRecitationInfo

Get recitation info.

- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/recitation-info)

**Params:**

`resources.findRecitationInfo(id: string, options?: GetResourceOptions)`

| Param | Type |
| ------- | -------------------- |
| id | `string` |
| options | `GetResourceOptions` |

**Example:**

```js
quran.v4.resources.findRecitationInfo('1');
```

## findAllRecitationStyles

Get all recitation styles.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/recitation-styles)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/recitation-styles)

**Example:**

Expand All @@ -94,7 +115,7 @@ quran.v4.resources.findAllRecitationStyles();

Get all tafsirs.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/tafsirs)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/tafsirs)

**Params:**

Expand All @@ -110,11 +131,32 @@ Get all tafsirs.
quran.v4.resources.findAllTafsirs();
```

## findTafsirInfo

Get tafsir info.

- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/tafsir-info)

**Params:**

`resources.findTafsirInfo(id: string, options?: GetResourceOptions)`

| Param | Type |
| ------- | -------------------- |
| id | `string` |
| options | `GetResourceOptions` |

**Example:**

```js
quran.v4.resources.findTafsirInfo('1');
```

## findAllTranslations

Get all translations.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/translations)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/translations)

**Params:**

Expand All @@ -130,11 +172,32 @@ Get all translations.
quran.v4.resources.findAllTranslations();
```

## findTranslationInfo

Get all translations.

- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/translation-info)

**Params:**

`resources.findTranslationInfo(id: string, options?: GetResourceOptions)`

| Param | Type |
| ------- | -------------------- |
| id | `string` |
| options | `GetResourceOptions` |

**Example:**

```js
quran.v4.resources.findTranslationInfo('169');
```

## findVerseMedia

Get verse media.

- [Quran.com API Docs](https://quran.api-docs.io/v4/resources/verse_media)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/verse-media)

**Params:**

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/search.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## search

- [Quran.com API Docs](https://quran.api-docs.io/v4/search/KfCmk4KQYbtyK9adj)
- [Quran.com API Docs](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/search)

**Params:**

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/techniques.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Custom fetcher

By default, all functions that interact with the [Quran.com API](https://quran.api-docs.io/v4) use the global `fetch` function.
By default, all functions that interact with the [Quran.com API](https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/quran-com-api) use the global `fetch` function.

You can override this by passing a custom fetcher (as `fetchFn`) to the options object of any method.

Expand Down
Loading

0 comments on commit efd77f9

Please sign in to comment.