Skip to content

Commit 99cb036

Browse files
authored
Merge pull request #19 from membraneframework/creating_new_plugin_tutorial
Creating new plugin tutorial
2 parents 7d4956d + e41dd6f commit 99cb036

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Creating your own plugin
2+
3+
During the development of Membrane Framework we aim at designing fewer, but higher quality plugins. However, we also kept extendability and reusability in mind. That's why it is easy for developers like you to create their own custom plugin, which satisfies their needs.
4+
5+
In this short guide we provide you with an overview of how to create your own Membrane plugin and how to integrate it into your project.
6+
7+
# Membrane plugin template
8+
9+
To create a new plugin, we recommend using the [template](https://github.com/membraneframework/membrane_template_plugin) that has been made for this very purpose and which will be the base of your plugin.
10+
It defines necessary dependencies as well as other project specs, e.g. formatting, and guarantees you compliance with other Membrane components.
11+
12+
You can start creating a plugin by making your copy of the template. Go to the [github repo](https://github.com/membraneframework/membrane_template_plugin) and select `Use this template`. Then choose an appropriate name for the project.
13+
14+
If you haven't already, we suggest you read [basic pipeline tutorial](/basic_pipeline/01.0_Introduction.md) to get familiar with Membrane's plugin structure. In any case, as you might have guessed the code of your plugin will go into `/lib` directory and the tests belong in the `/test` directory.
15+
16+
# Utilizing your plugin in a project
17+
18+
When your plugin is ready for being integrated into another project you can simply add it as a dependency in `mix.exs` as described [here](https://hexdocs.pm/mix/Mix.Tasks.Deps.html). Here's what it can look like:
19+
20+
```Elixir
21+
defp deps do
22+
[
23+
...
24+
{:your_membrane_plugin, git: "https://github.com/githubuser/your_membrane_plugin", tag: "0.1"} # dependency from github
25+
{:your_membrane_plugin, ">=0.1.0"} # dependency from [hex](https://hex.pm/)
26+
{:your_membrane_plugin, path: "path/to/your_plugin"} # dependency from local file
27+
...
28+
]
29+
end
30+
```
31+
32+
And just like this, you have added your plugin to a project.

0 commit comments

Comments
 (0)