Integrate your plugin with Ink Away
Start here. You need Lua and a KOReader plugin; no Ink Away knowledge is assumed.
Ink Away offers includes a public API that allows other plugins to connect to it, and extend its functionality, like mods. This way is easier integrate other plugins with Ink Away without messing its internals or having to "monkey-patch" it.
What you can do?
Your plugin can subscribe and be notified of all "Ink-Away" important events like:
- Opening Annotator Book Layer
- Closing ********************
- Option to give him a custom view renderer.
- & more
Aha, like what I can do with this?
Example #1: Panels+ Plugin
This plugin has its own view render and needs to know when the button > or < are pressed so it executes Panels+ next panel or previous
panel behavior. This means that:
- You need Ink-Away to notify you when those buttons are pressed.
- You need to tell Ink-Away to use a custom document viewer render, instead of KOReader default one.
So this Ink-away public API exposes events and methods to make that possible in first place.
Useful nomenclature
Troughout this section, we'll be using the following terms:
uiis KOReader's reader UI for the open book. In your plugin, this is normallyself.ui.inkis the ready Ink Away plugin instance. Use it to call the public methods.- Consumer means your plugin object, or the object that owns its integration.
- Viewer is your actual KOReader widget that displays content. Only rendering consumers need one.
- Surface is a Lua table that tells Ink Away how your viewer's screen positions map to the book's original page coordinates.