This template repository contains example functionality, which makes it an excellent starting point for developing a new JASP module. It contains the necessary files and structure, plus a numbers of examples to get started and to understand JASP's internals.
- Fork this template repository to your own GitHub account
- Clone it to your machine
- Open JASP and add it as a development module
It is very illuminating to take a look at our examples and at the files that generate them.
For instance, the image below shows the different menus for the "Using the interface" analysis, together with the files that generate them:
Feel free to reuse and adapt to your needs. Feel also free to remove the ones you don't need.
With hasWrappers: true in inst/Description.qml, every analysis can also be run from R, e.g. jaspModuleTemplate::addOne(my_number = 41).
The analysis code itself is the function <func>Internal (e.g. addOneInternal in R/addOne.R); R/<func>Wrapper.R and man/<func>.Rd are generated from the QML form, with one argument per option.
Export both names in NAMESPACE.
Do not edit the generated files: the workflow .github/workflows/update-wrappers.yml regenerates them on every push to master that changes a form or inst/Description.qml, and commits them.
To regenerate them locally, run Rscript update-wrappers/updateWrappers.R <path to the module> from a checkout of jasp-actions, with jaspSyntax and roxygen2 installed.
Once you have developed your module, you can contribute it back to JASP by creating a pull request. The JASP team will review your module and provide feedback. Once your module is accepted, a new repo is created in the JASP organization and your module is added to the JASP module repository.
