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.
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 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 must implement the following fixed functions. Rulia will call them at the appropriate times:
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).
Fetches manga details. Returns an object containing title, description, coverUrl, chapterList, and an optional lastReadChapter.
Return the result via window.Rulia.endWithResult(result).
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).
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.
You can use this package to get type hints in your editor.