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 232a3f6
Show file tree
Hide file tree
Showing 2 changed files with 6 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.app.SnakeBidsApp>` as input and returns either a modified {class}`SnakeBidsApp <snakebids.app.SnakeBidsApp>` or `None`. To add one or more plugins to your {class}`SnakeBidsApp <snakebids.app.SnakeBidsApp>`, use the method {func}`add_plugins <snakebids.app.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.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ bids_function/overview
bids_app/overview
bids_app/config
bids_app/workflow
bids_app/plugins
```

```{toctree}
Expand Down

0 comments on commit 232a3f6

Please sign in to comment.