From 232a3f672862bdfbc776447935fb25859b302232 Mon Sep 17 00:00:00 2001 From: Tristan Kuehn Date: Tue, 7 Mar 2023 16:21:23 -0500 Subject: [PATCH] First attempt at Sphinx docs --- docs/bids_app/plugins.md | 5 +++++ docs/index.md | 1 + 2 files changed, 6 insertions(+) create mode 100644 docs/bids_app/plugins.md diff --git a/docs/bids_app/plugins.md b/docs/bids_app/plugins.md new file mode 100644 index 00000000..3ee91d1b --- /dev/null +++ b/docs/bids_app/plugins.md @@ -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 ` as input and returns either a modified {class}`SnakeBidsApp ` or `None`. To add one or more plugins to your {class}`SnakeBidsApp `, use the method {func}`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. diff --git a/docs/index.md b/docs/index.md index b99997ae..b81dbbfc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -39,6 +39,7 @@ bids_function/overview bids_app/overview bids_app/config bids_app/workflow +bids_app/plugins ``` ```{toctree}