Structure
Moodle's Developer Resource system is built using Docusaurus. Docusaurus is a static page generator aimed at technical documentation and maintained by Facebook. It is written in JavaScript, and uses React.
General structure
The documentation is broken down into two key areas:
- Versioned documentation used for version-specific items such as API guides; and
- General documentation covering a wide range of versions.
Sometimes it isn't immediately clear which of the two areas you should use - unless you are writing an API guide then your documentation probably belongs in the unversioned area.
Unversioned documentation
The unversioned documentation can be found in the general folder and is further broken down into several categories:
- Community information such as our roadmap, mission statement, support channel information, developer meeting information and more
- Credits, including lists of contributors to the developer and user documentation, a list of the third-party libraries we use, and similar credits
- Release notes for all versions of Moodle
- Release notes for the Mobile app
- Project documentation, plans, and similar items
- Information about this documentation
- General information relating to development of Moodle which is further broken down into:
- Policy information such as coding style guides
- Information on our development processes
- Summary documentation for development tools
- Useful information about the Moodle Tracker
If you are creating a page which does not fit into one of these categories, we suggest you jump into the Developer documentation chat and asking there; or creating a new issue in the GitHub repository to discuss the best location.
Versioned documentation
The versioned documentation has two locations you will need to look at:
- For the Moodle main branch, see the docs folder
- For older versions of Moodle which are documented here, see the versioned_docs folder
The versioned documentation has not yet been created and will happen soon.
Examples of the content documented in the versioned documentation includes:
- Language and feature guides correct for the relevant version of Moodle, for example:
- our JavaScript guides; and
- our Mustache template guide.
- API guides for:
- the Moodle core subsystems;
- the Plugin types shipped with Moodle core; and
- Common files that are used in Plugins.
- Key upgrade notes for developers.
The Moodle App developer documentation is currently in the docs
location but will be moved in the near future.
Other key files and folders
A number of other files are also used to form the documentation, some of these are described below.
Sidebar configuration
All pages should include contextually relevant navigation in the form of a sidebar. The content of these sidebars is controlled from the sidebar configuration with configuration for:
Additional sidebar configuration for older versions of Moodle will also be created in future.
Documentation for the sidebars feature can be found on the Docusaurus site.
Data
Rather than storing machine-readable data within the documentation, we store some key information in the data folder. This includes:
- a list of migrated pages
- a list of Moodle components used by the spell checker
- a list of Moodle contributors used by the spell checker
- Project metadata used to generate project summary data, and sidebar information
- Information about Moodle versions used to generate the Release notes pages
Static content
Docusaurus generates most of the content, converting markdown files, JavaScript, TypeScript, and React component into static files. Sometimes it is still necessary to include static content too.
The static
folder contains all of the static resources into the build, including:
- images
- fonts
- a manifest.json file used for the Web App Manifest
- a set of JSON Schemas used to formally describe some of the data files