Skip to content

Commit

Permalink
fix [skip ci]: documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
riimuru committed Jun 24, 2022
1 parent 2acc0bd commit c220748
Show file tree
Hide file tree
Showing 18 changed files with 607 additions and 129 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set
* text=auto

# Require Unix line endings
* text eol=lf
88 changes: 46 additions & 42 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Contributing

This guide is for the people who are interested in contributing to Consumet Extensions. It is not a complete guide yet, but it should help you get started. If you have any questions or any suggestions, please open a [issue](https://github.com/consumet/extensions/issues/new?assignees=&labels=Bug&template=bug-report.yml&title=%5BBug%5D%3A+) or join the [discord server](https://discord.gg/qTPfvMxzNH).
This guide is for the people who are interested in contributing to Consumet Extensions. It is not a complete guide yet, but it should help you get started. If you have any questions or any suggestions, please open a [issue](https://github.com/consumet/extensions/issues/new?assignees=&labels=Bug&template=bug-report.yml) or join the [discord server](https://discord.gg/qTPfvMxzNH).

### Prerequisites
To contribute to Consumet code, you need to have knowledge of the following technologies.
## Prerequisites
To contribute to Consumet code, you need to know the following:
- [Nodejs](https://nodejs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- Web scraping
Expand All @@ -12,21 +12,21 @@ To contribute to Consumet code, you need to have knowledge of the following tech
- [Css Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
- [DevTools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools)

#### Cloning the repository
### Cloning the repository
1. Clone the repository.
```bash
git clone https://github.com/consumet/extensions.git
```
1. Install dependencies. **Using Yarn**.
2. Install dependencies. **Using Yarn**.
```bash
yarn install
```
3. create a new branch using the name of the provider (source) you want to add.
```bash
git checkout -b <provider-name>
git checkout -b <provider-name> # or any name you find suitable
```

### Writing a provider
## Writing a provider
Each provider is a class that extends abstract class. For example, `Libgen` provider extends `BooksParser` class, and `Gogoanime` extends `AnimeParser`. the parser abstract classes can be found in the `src/models/` folder as follows:
```bash
src/models/anime-parser.ts # AnimeParser
Expand All @@ -37,42 +37,46 @@ src/models/manga-parser.ts # MangaParser
```
You are welcome to add anything to the abstract class that you believe will be beneficial.

#### visualization of the abstract classes hierarchy
<details>
<summary>
visualization of the abstract classes hierarchy
</summary>

```mermaid
classDiagram
ProviderBase <|-- BaseParser
ProviderBase : +String name
ProviderBase : +String baseUrl
ProviderBase: +toString()
BaseParser <|-- AnimeParser
BaseParser <|-- BookParser
BaseParser <|-- MangaParser
BaseParser <|-- LightNovelParser
BaseParser <|-- ComicParser
class BaseParser{
+search(String query)
}
class AnimeParser{
+fetchAnimeInfo(String animeId)
+fetchEpisodeSources(String episodeId)
+fetchEpisodeServers(String episodeId)
}
class BookParser{
empty
}
class MangaParser{
+fetchMangaInfo(String mangaId)
+fetchChapterPages(String chapterId)
}
class ComicParser{
empty
}
class LightNovelParser{
+fetchLighNovelInfo(String lightNovelId)
+fetchChapterContent(String chapterId)
}
```
```mermaid
classDiagram
ProviderBase <|-- BaseParser
ProviderBase : +String name
ProviderBase : +String baseUrl
ProviderBase: +toString()
BaseParser <|-- AnimeParser
BaseParser <|-- BookParser
BaseParser <|-- MangaParser
BaseParser <|-- LightNovelParser
BaseParser <|-- ComicParser
class BaseParser{
+search(String query)
}
class AnimeParser{
+fetchAnimeInfo(String animeId)
+fetchEpisodeSources(String episodeId)
+fetchEpisodeServers(String episodeId)
}
class BookParser{
empty
}
class MangaParser{
+fetchMangaInfo(String mangaId)
+fetchChapterPages(String chapterId)
}
class ComicParser{
empty
}
class LightNovelParser{
+fetchLighNovelInfo(String lightNovelId)
+fetchChapterContent(String chapterId)
}
```
</details>


#### Project structure
Expand Down
50 changes: 38 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
<p align="center"><img src="assets/images/consumetlogo.png" width="225"/></p>
<p align="center"><img src="assets/images/consumetlogo.png" width="175"/></p>

# Consumet Extentions
<h1 align="center"> Consumet Extentions </h1>

Consumet Extensons is a Node library which provides high-level APIs to get information about several entertainment mediums like books, movies, comics, anime, manga, etc.

<p align="center">
<a href="https://www.npmjs.com/package/@consumet/extensions">
<img src="https://img.shields.io/npm/v/@consumet/extensions?style=flat-square" alt="npm (scoped)">
<img src="https://img.shields.io/npm/v/@consumet/extensions" alt="npm (scoped)">
</a>
<a href="https://github.com/consumet/extensions/actions?query=workflow%3A%2Node.js+CI%22">
<img src="https://img.shields.io/github/workflow/status/consumet/extensions/Node.js%20CI/master?style=flat-square" alt="GitHub Workflow Status (branch)">
<img src="https://img.shields.io/github/workflow/status/consumet/extensions/Node.js%20CI/master" alt="GitHub Workflow Status (branch)">
</a>
<a href="https://discord.gg/qTPfvMxzNH">
<img src="https://img.shields.io/discord/987492554486452315.svg?label=discord&labelColor=7289da&color=2c2f33" alt="Discord">
</a>
</p>

## Get Started
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Quick Start](#quick-start)
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)
- [Ecosystem](#ecosystem)
- [Provider Request](#provider-request)
- [Contributing](#contributing)
- [Support](#support)
- [License](#license)

## Quick Start

### Installation

Expand Down Expand Up @@ -59,14 +71,28 @@ const main = async () => {
}
```

## Resources
* [API Documentation](https://github.com/consumet/extensions/tree/master/docs)
* [Examples](https://github.com/consumet/extentions/tree/master/examples)
* [Provider Status](https://github.com/consumet/providers-status/blob/main/README.md)
* [Changelog](https://github.com/consumet/extensions/blob/master/CHANGELOG.md)
Do you want to know more? Head to the [`Getting Started`](https://github.com/consumet/extensions/tree/master/docs/guides/getting-started).

## Documentation
- [`Getting Started`](https://github.com/consumet/extensions/tree/master/docs/guides/getting-started.md)
- [`Guides`](https://github.com/consumet/extensions/tree/master/docs)

## Ecosystem
- [Examples](https://github.com/consumet/extentions/tree/master/examples) - examples of using Consumet Extensions
- [Provider Status](https://github.com/consumet/providers-status/blob/main/README.md) - A list of providers and their status.
- [Changelog](https://github.com/consumet/extensions/blob/master/CHANGELOG.md) - See the latest changes
- [Discord Server](https://discord.gg/qTPfvMxzNH) - Join our discord server and chat with the maintainers.

## Provider Request
Make a new issue with the label `Provider Request`, And the name of the provider on the title, as well as a link to the provider in the body paragraph.

## Contributing to Consumet Extensions
Check out [contributing guide](https://github.com/consumet/extensions/blob/master/CONTRIBUTING.md#contributing) to get an overview of Consumet Extensions development.
## Contributing
Check out [contributing guide](https://github.com/consumet/extensions/blob/master/docs/guides/contributing.md) to get an overview of Consumet Extensions development.

## Support

Please join the [discord server](https://discord.gg/qTPfvMxzNH) to ask questions, get help, or report issues.

## License

Licensed under [MIT](./LICENSE).
67 changes: 8 additions & 59 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,9 @@
```mermaid
classDiagram
ProviderBase <|-- BaseParser
ProviderBase : +String name
ProviderBase : +String baseUrl
ProviderBase: +toString()
BaseParser <|-- AnimeParser
BaseParser <|-- BookParser
BaseParser <|-- MangaParser
class BaseParser{
+search(String url)
}
class AnimeParser{
+fetchAnimeInfo(String animeUrl)
+fetchEpisodeSources(String episodeUrl)
+fetchEpisodeServers(String episodeUrl)
}
class BookParser{
+fetchBookInfo(String bookUrl)
}
class MangaParser{
+fetchMangaInfo(String mangaUrl)
}
```
<h1 align="center">Consumet Extensions</h1>
<h2> Table of Contents </h2>

#

```mermaid
flowchart
A(src)-->B(models)
A-->C(providers);
A-->D(utils);
B-->base-parser.ts
B-->anime-parser.ts
B-->book-parser.ts
B-->manga-parser.ts
B-->view-extractor.ts
B-->types.ts
C-->H(anime)
C-->I(books)
C-->J(manga)
C-->K(others)
D-->E(extractors)
E-->gogocdn.ts
E-->streamsb.ts
D-->utils.ts
H-->F(all)
H-->G(en)
I-->L(all)
I-->M(en)
J-->N(all)
J-->O(en)
K-->P(all)
K-->Q(en)
G-->gogoanime.ts
G-->9anime.ts
L-->lebgen.ts
```;
- [Getting Started](./guides/getting-started.md): Introduction tutorial for Consumet Extensions. This is where beginners should start.
- [Anime](./guides/anime.md): How to use the anime providers.
- [Manga](./guides/manga.md): How to use the manga providers.
- [Light Novel](./guides/light-novels.md): How to use the light novel providers.
- [Benchmarks](https://github.com/consumet/providers-status#readme): Real-time benchmarking of providers.
- [Contributing](./guides/contributing.md): Details about how to contribute to Consumet Extensions.
Loading

0 comments on commit c220748

Please sign in to comment.