Git Product home page Git Product logo

lite-xl-sample-native-plugin's Introduction

Lite XL Sample Native Plugin

This repository provides a working skeleton that you can use as a base to build and share your own native plugins. Clone this repository, make any necessary changes and publish it to a GitHub repository of your own. Make sure to enable GitHub Actions, then go to Actions -> Release and hit: Run workflow to let GitHub build a binary for you.

Some of the files that you will find on this repo are:

  • manifest.json - Used by lpm (the Lite XL package manager) for automated installation.
  • .github/workflows/release.yml - Commands to let GitHub Actions automatically build a binary.
  • changelog.md - Read by GitHub Actions to make a release, always a good idea to keep this updated.
  • lite_xl_plugin_api.h - Used to import Lua symbols directly from the running Lite XL instance. Latest version of this file is found on https://github.com/lite-xl/lite-xl/blob/master/resources/lite_xl_plugin_api.h

Building

You will need to have meson and a working build environment for your operating system. Then, to build just execute the following commands:

meson setup build
meson compile -C build

(Not Recommended) If you do not want to use the same Lua linked to Lite XL, use -Duse_lua=enabled. This will link with the system lua skipping the use of lite_xl_plugin_api.h header and not importing the required symbols directly from Lite XL:

meson setup -Duse_lua=enabled build

Notice: the subprojects directory contains a lua and luajit meson wraps. These are used in case you decide to not depend on lite_xl_plugin_api.h for lua symbols importing, and your system does not has the targeted lua runtime installed. In this case it will download the runtime, compile it and statically link to it. Also you can force using the meson wraps by using the flag --wrap-mode forcefallback:

meson setup --wrap-mode forcefallback build

Also you can try and link against LuaJIT for testing purposes by adding -Djit=true:

meson setup -Djit=true build

Installation

To install just copy the generated native library file to your plugins directory:

mkdir -p ~/.config/lite-xl/plugins/sample
cp build/native.so ~/.config/lite-xl/plugins/sample/

Then install the Lua part of the plugin:

cp init.lua ~/.config/lite-xl/plugins/sample/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.