Skip to content

Commit

Permalink
First attempt at Sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tkkuehn committed Mar 7, 2023
1 parent eb447b0 commit c4e9d9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/bids_app/plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Plugins

Plugins are a Snakebids feature that allow you to add arbitrary behaviour to your Snakebids app after CLI arguments are parsed but before Snakemake is invoked. For example, you might add BIDS validation of an input dataset to your app via a plugin, so your app is only run if the input dataset is valid.

A plugin is simply a function that takes a {class}`SnakeBidsApp <snakebids.SnakeBidsApp>` as input and returns either a modified {class}`SnakeBidsApp <snakebids.SnakeBidsApp>` or `None`. To add one or more plugins to your {class}`SnakeBidsApp <snakebids.SnakeBidsApp>`, use the method {func}`add_plugins <snakebids.SnakeBidsApp.add_plugins>`, which will typically be easiest in a `run.py` or similar entrypoint to your app. Your plugin will have access to CLI parameters via `SnakeBidsApp.config`, but you're responsible for making sure that your app provides the properties a plugin expects to find in the config.

0 comments on commit c4e9d9e

Please sign in to comment.