Skip to content

RuliaReader/plugin.example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Plugin Template

This is a Rulia plugin template. If you are interested in developing a plugin, you can use this template as a starting point.

Rulia reads the index.js file inside a plugin and calls a set of fixed functions defined within it. As long as you can produce the expected output file, you are free to use other languages such as TypeScript.

Plugin Structure

A plugin directory should contain the following files:

your-plugin/
├── icon.png         # Plugin icon
├── index.js         # Plugin entry file
├── package.json     # Plugin metadata
└── README.md        # Plugin description (visible in the Rulia App)

package.json

package.json describes the basic metadata of the plugin:

{
  "name": "my-simple-plugin",
  "version": "1.0.0",
  "description": "My simple plugin.",
  "private": true,
  "author": {
    "name": "A genius",
    "email": "genius_on_earth@thats.me"
  }
}

index.js

index.js must implement the following fixed functions. Rulia will call them at the appropriate times:

getMangaList(page, pageSize, keyword)

Fetches a list of manga. Returns an object with a list array, where each item contains title, url, and cover.

Return the result via window.Rulia.endWithResult(result).

getMangaData(url)

Fetches manga details. Returns an object containing title, description, coverUrl, chapterList, and an optional lastReadChapter.

Return the result via window.Rulia.endWithResult(result).

getChapterImageList(chapterUrl)

Fetches the image list for a chapter. Returns an array where each item contains url, width, and height.

Return the result via window.Rulia.endWithResult(result).

getImageUrl(imageUrl)

Called before Rulia downloads an image. You can handle authorization or URL transformation here, and return the final image URL.

See example/index.js for a complete example.

For TypeScript users

You can use this package to get type hints in your editor.

About

This is a Rulia plugin template. If you are interested in developing a plugin, you can use this template as a starting point.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors