Skip to content

Instantly share code, notes, and snippets.

Developing your first plugin for KOReader

So, you've been using KOReader on your phone, jailbroken Kindle, or some other device, and realized you want to have some functionality that's not built into it. You've probably looked around in the #koplugin tags on Github, and there wasn't one that met your needs. Good news: KOReader is easily extendable with Lua, you can make your own plugin somewhat easily, provided you know some Lua or are willing to learn the basics!

In this post, we'll go over what you need to set up to make your plugin, and write a basic "Hello World" plugin. For in-depth reference on KOReader's Lua components and examples of more complicated plugins, please look at the source code over at [[their github repo]]. We will briefly go over some basics of Lua here, but this is not a Lua tutorial. Please refer to the [[Lua documentation]] if you want to know more.

Setting up

Programming without in-editor hints and context-aware autocomplete isn't the best experience, so let's start by setting

@DraconicDragon
DraconicDragon / doodle.css
Created January 29, 2024 18:51
Discord Custom CSS with collapsable SideBars
:root {
--sidebar-w-collapsed: 36px; /*used for collapsable sidebar*/
--sidebar-h-extended: 240px;
--memberlist-collapsed: 62px;
--memberlist-expanded: 240px;
--memberlist-transition: 0.35s ease-in-out;
}
/*vc text is correct with channel sidebar and main chat margin*/
.chat_f8f70f { margin-left: 0px !important; }