# 신경 plugin

A library that provides the plugin API for [신경](
This library is not useful on its own, and must be used alongside a 신경 instance.

An example plugin can be found here:

## Installation

[Get it on Hex.](

def deps do
    {:singyeong_plugin, "~> 0.1.0"}

## Creating a plugin

Simply implement the `Singyeong.Plugin` behaviour in your plugin module. An
example of how to do this can be found here:

Once your plugin is ready, run the following commands:
$ mix compile
$ mix singyeong.package
and a zip file containing your plugin will be created. To use the plugin you
created, simply create a `plugins/` directory at your 신경 instance's root
directory, and copy the plugin zip into that directory.

## Native code

신경 plugins officially support NIFs implemented with [Rustler](
Other NIF libraries are unsupported and may break at any time, or simply never

Note that Rustler-based NIFs require some extra steps to be properly

1. Your NIF module should have `use Singyeong.Plugin.Rustler, crate: "crate_name"`
   instead of `use Rustler, otp_app: :my_app, crate: "crate_name"`.
2. That's it! (Note: this may change in the future)

## `.gitignore`

The following files should be added to your `.gitignore`:

- /work
- /*.zip

If using (Rustler) natives:

- /priv/native
- /native/*/target
- /native/*/.cargo