Moodle plugin skeleton generator

Administration tool ::: tool_pluginskel
Maintained by David Mudrák
Allows developers to quickly generate code skeleton for a new Moodle plugin.
Latest release:
679 sites
1k downloads
89 fans
Current versions available: 4

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

  1. Go to the folder with your Moodle development installation:

    $ cd {your/moodle/dirroot}

  2. Clone this repository to the correct location folder:

    $ git clone https://github.com/mudrd8mz/moodle-tool_pluginskel.git admin/tool/pluginskel

  3. Complete the installation:

    $ sudo -u www-data php admin/cli/upgrade.php

or just log in to your Moodle development site as an admin.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

David Mudrák (Lead maintainer)
Alexandru Elisei: Original author (GSOC 2016 student)
Geoffrey Van Wyk
Ferran Recio Calderó
Daniel Neis Araujo
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Mike Churchward
    Tue, 25 Apr 2017, 10:03 PM
    It currently doesn't allow you to use 3.2 as the required Moodle version (dropdown). Does that mean we should not use it for 3.2 (or higher) plugin development?
  • David Mudrák
    Tue, 25 Apr 2017, 11:00 PM

    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.

  • David Mudrák
    Fri, 1 June 2018, 10:14 PM

    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.

  • steve baxter
    Thu, 25 Apr 2019, 6:09 PM
    I'm probably missing something really obvious here but my generated mod skeleton does not have an install.xml file so has no means to create initial tables. Many thanks in advance.
  • David Mudrák
    Fri, 26 Apr 2019, 4:49 PM

    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.

  • David Mudrák
    Fri, 11 Oct 2019, 6:45 PM

    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.

  • David Mudrák
    Thu, 9 Feb 2023, 7:46 AM

    Version 1.6.0 was just released, introducing support for course formats and tinymce subplugins.

Please login to post comments