Skip to content

About

Official source plugins for Flow Reader

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

flow-reader-plugins

Official source plugins for Flow Reader. Each folder is one plugin (plugin.json + index.js, sandboxed JavaScript). The app ships no plugins; it installs them from this repository's published index:

https://oxika95.github.io/flow-reader-plugins/index.json

That URL is pre-added in Flow Reader under Settings → Plugins.

Folder Plugin Site
RoyalRoad/ Royal Road (royalroad, book ids rr:*) royalroad.com
Patreon/ Patreon (patreon, book ids pt:*): a creator's posts as stories (all posts, collections, tags); Memberships is a browse list of creator pages (About, Posts, Collections, Membership tabs) patreon.com

Writing a plugin

The contract lives in the app repo:

Plugins never draw UI and never touch the app's storage. They fetch and parse a site through flow.* and return plain JSON. A plugin can fill the story media card's slots (stats, badges, links, up to two rail and two footer actions); the app owns layout, theme, and the core actions. A plugin can also declare the updates capability and implement checkUpdates(works) so the app's background new-chapter check needs few requests. Sites whose login needs a captcha or OAuth can declare auth.web ({ url, doneCookie }): the app signs in on the site's own page and hands the cookies to the plugin, which then needs only session() and logout(). The app is in alpha and accepts only the current apiVersion (4); npm run build rejects anything else.

  1. Create YourSite/plugin.json and YourSite/index.js (CommonJS: assign to module.exports).
  2. Add tests under test/ using the Node host in test/host.mjs, which mirrors the app's flow API (Jsoup-style HTML nodes, non-throwing fetch, per-plugin secrets).
  3. Bump version in plugin.json for every release; the app only offers higher versions as updates.
  4. npm run build to regenerate index.json (sha256 of each file; the app refuses mismatches).

Never change a published plugin's id or bookIdPrefix: they key users' books, data, and sign-in.

Commands

npm install
npm test          # plugin tests (Node host)
npm run build     # regenerate index.json
npm run check     # fail if index.json is stale (CI)

Trying changes on a device

Debug builds of Flow Reader bundle this checkout when it sits next to the app repo (C:\Git\flow-reader-plugins beside C:\Git\flow-reader), or wherever -PflowPluginsDir=... points, and reinstall it whenever the files change:

cd ../flow-reader
./gradlew :app:installDebug

Publishing

Pushing to main runs .github/workflows/publish.yml: tests, index check, then deploys index.json and each plugin folder to GitHub Pages. Enable Pages with Source: GitHub Actions in the repository settings.

About

Official source plugins for Flow Reader

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages