Moodle Plugins directory: Moodle plugin skeleton generator | Moodle.org
Moodle plugin skeleton generator
Warning! This plugin is no longer maintained. It may work in recent Moodle versions but there is no support. For details of how you can become the new maintainer, see Plugins adoption programme.
This tool allows developers to quickly generate code skeleton for Moodle plugins. Relevant code is generated according to defined list of requested plugin features.
Usage
Plugin features and other properties are described in so called recipe files. Recipes use YAML syntax.
name: Moodle demo plugin
component: tool_demo
release: "0.1.0"
requires: "3.9"
maturity: MATURITY_ALPHA
copyright: 2021 David Mudrák
features:
readme: true
license: true
settings: true
privacy:
haspersonaldata: false
For full list of supported options, see cli/example.yaml file.
To generate skeleton of the plugin described in ./myplugin.yaml
:
$ php cli/generate.php myplugin.yaml
Run generate.php --help
for more options and features.
Documentation
See the page Plugin skeleton generator at moodle docs site.
Installing from Git
Go to the folder with your Moodle development installation:
$ cd {your/moodle/dirroot}
Clone this repository to the correct location folder:
$ git clone https://github.com/mudrd8mz/moodle-tool_pluginskel.git admin/tool/pluginskel
Complete the installation:
$ sudo -u www-data php admin/cli/upgrade.php
or just log in to your Moodle development site as an admin.
I believe it just needs to be updated. A pull request at github will be appreciated, or an issue created there at least. Thanks in advance.
Version 1.1.0 released, allowing to generate privacy API scaffolding. No UI at the moment, manually edited input YAML recipes only. Refer to cli/example.yaml.
Hi Steve. IIRC that is expected behaviour as the XMLDB editor is more appropriate tool to create this file. What I used to do was (1) generate the module's skeleton inside a Moodle installation (2) go directly to the site's /admin/tool/xmldb/ address (that is the annoying part where you have to avoid visiting the Notifications page that would trigger the plugin installation) and (3) create the module's install.xml using the XMLDB and (4) finally install the plugin.
I agree this is rather cumbersome workflow. Please feel encouraged to report a new feature request so that plugins come with a bare-minimal working install.xml out of the box.
For the record, the most recent version 1.2.3 has (among other things) the support for generating a minimal db/install.xml implemented. Thanks again Steve for raising it.
Version 1.6.0 was just released, introducing support for course formats and tinymce subplugins.