diff --git a/.lintstagedrc.json b/.lintstagedrc.json index a4df6a9184..01bb87429a 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,6 +1,10 @@ { "*.css": ["stylelint --allow-empty-input --fix"], "*.{js,jsx,ts,tsx,mjs}": ["eslint --fix"], + "*.mdx": [ + "markdownlint-cli2-config .markdownlint/mdx/fix/.markdownlint-cli2.cjs", + "cspell --no-must-find-files --no-progress" + ], "*.md": [ "markdownlint-cli2-fix", "cspell --no-must-find-files --no-progress" diff --git a/.markdownlint/mdx/.markdownlint-cli2.cjs b/.markdownlint/mdx/.markdownlint-cli2.cjs new file mode 100644 index 0000000000..05a04980e1 --- /dev/null +++ b/.markdownlint/mdx/.markdownlint-cli2.cjs @@ -0,0 +1,29 @@ +/** + * Copyright (c) Moodle Pty Ltd. + * + * Moodle is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Moodle is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Moodle. If not, see . + */ + +// For full details on all of these configuration settings: +// https://github.com/DavidAnson/markdownlint#rules--aliases + +const config = require('../../.markdownlint-cli2.cjs'); + +// MD033/no-inline-html - Inline HTML +config.config.MD033 = false; + +// MD038/no-space-in-code Spaces inside code span elements +config.config.MD038 = false; + +module.exports = config; diff --git a/.markdownlint/mdx/fix/.markdownlint-cli2.cjs b/.markdownlint/mdx/fix/.markdownlint-cli2.cjs new file mode 100644 index 0000000000..0f877dba55 --- /dev/null +++ b/.markdownlint/mdx/fix/.markdownlint-cli2.cjs @@ -0,0 +1,26 @@ +/** + * Copyright (c) Moodle Pty Ltd. + * + * Moodle is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Moodle is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Moodle. If not, see . + */ + +// For full details on all of these configuration settings: +// https://github.com/DavidAnson/markdownlint#rules--aliases + +const config = require('../.markdownlint-cli2.cjs'); + +// Apply the fix. +config.fix = true; + +module.exports = config; diff --git a/docs/apis/_files/amd-dir.mdx b/docs/apis/_files/amd-dir.mdx index e4acfd8cba..2e9c7b089f 100644 --- a/docs/apis/_files/amd-dir.mdx +++ b/docs/apis/_files/amd-dir.mdx @@ -1,6 +1,7 @@ + JavaScript in Moodle is written in the ESM format, and transpiled into AMD modules for deployment. -The [Moodle JavaScript Guide](../guides/javascript) has detailed information and examples on writing JavaScript in Moodle. Further information is also available in the [[Javascript Modules]] documentation. +The [Moodle JavaScript Guide](../guides/javascript) has detailed information and examples on writing JavaScript in Moodle. Further information is also available in the [Javascript Modules](https://docs.moodle.org/dev/Javascript_Modules) documentation. :::caution diff --git a/docs/apis/_files/backup-dir.mdx b/docs/apis/_files/backup-dir.mdx index 36576a0fe1..7b77168eb2 100644 --- a/docs/apis/_files/backup-dir.mdx +++ b/docs/apis/_files/backup-dir.mdx @@ -1,6 +1,7 @@ + If your plugin stores data then you may need to implement the Backup feature which allows the activity to backed up, restored, and duplicated. For more information on Backup and restore, see the following: -- [[Backup_2.0_for_developers]] -- [[Restore_2.0_for_developers]] +- [Backup 2.0 for developers](https://docs.moodle.org/dev/Backup_2.0_for_developers) +- [Restore 2.0 for developers](https://docs.moodle.org/dev/Restore_2.0_for_developers) diff --git a/docs/apis/_files/changes.mdx b/docs/apis/_files/changes.mdx index 5976f71bff..d4386313c8 100644 --- a/docs/apis/_files/changes.mdx +++ b/docs/apis/_files/changes.mdx @@ -1,4 +1,5 @@ -If your plugin includes a changelog in its root directory, this will be used to automatically pre-fill the release notes field when uploading new versions of your plugin to the [[Plugins directory]]. This file can be in any of the following locations: + +If your plugin includes a changelog in its root directory, this will be used to automatically pre-fill the release notes field when uploading new versions of your plugin to the [Plugins directory](https://docs.moodle.org/dev/Plugins_directory). This file can be in any of the following locations: - `CHANGES.md`: as a markdown file; or - `CHANGES.txt`: as a text file; or diff --git a/docs/apis/_files/classes-dir.mdx b/docs/apis/_files/classes-dir.mdx index 55b394b645..d5a522cef6 100644 --- a/docs/apis/_files/classes-dir.mdx +++ b/docs/apis/_files/classes-dir.mdx @@ -1,3 +1,4 @@ + Moodle supports, and recommends, the use of autoloaded PHP classes. By placing files within the `classes` directory or appropriate sub-directories, and with the correct PHP Namespace, and class name, Moodle is able to autoload classes without the need to manually require, or include them. @@ -5,4 +6,4 @@ By placing files within the `classes` directory or appropriate sub-directories, Details on these rules and conventions are available in the following documentation: - [Coding style - namespace conventions](/general/development/policies/codingstyle#namespaces) -- [[Automatic class loading]] +- [Automatic class loading](https://docs.moodle.org/dev/Automatic_class_loading) diff --git a/docs/apis/_files/cli-dir.mdx b/docs/apis/_files/cli-dir.mdx index e5d0a4962a..8757cadb97 100644 --- a/docs/apis/_files/cli-dir.mdx +++ b/docs/apis/_files/cli-dir.mdx @@ -1,4 +1,5 @@ -For plugins which make use of [[CLI scripts]], the convention is that these are placed into the `cli` folder to make their purpose clear, and easy to find. + +For plugins which make use of [CLI scripts](https://docs.moodle.org/dev/CLI_scripts), the convention is that these are placed into the `cli` folder to make their purpose clear, and easy to find. :::caution diff --git a/docs/apis/_files/db-access-php.mdx b/docs/apis/_files/db-access-php.mdx index 82bbf75190..f4bd89b3a4 100644 --- a/docs/apis/_files/db-access-php.mdx +++ b/docs/apis/_files/db-access-php.mdx @@ -1,10 +1,12 @@ + + The `db/access.php` file contains the __initial__ configuration for a plugin's access control rules. Access control is handled in Moodle by the use of Roles, and Capabilities. You can read more about these in the [Access API](../subsystems/access.md) documentation. :::caution Changing initial configuration -If you make changes to the initial configuration of _existing_ access control rules, these will only take effect for _new installations of your plugin_. Any existing installation **will not** be updated with the latest configuraiton. +If you make changes to the initial configuration of _existing_ access control rules, these will only take effect for _new installations of your plugin_. Any existing installation **will not** be updated with the latest configuration. Updating existing capability configuration for an installed site is not recommended as it may have already been modified by an administrator. diff --git a/docs/apis/_files/db-events-php.mdx b/docs/apis/_files/db-events-php.mdx index ec51c1ce64..11667d3c5e 100644 --- a/docs/apis/_files/db-events-php.mdx +++ b/docs/apis/_files/db-events-php.mdx @@ -1,4 +1,5 @@ -Moodle supports a feature known as _ [[Events_API#Event_observers|Event observers]] _ to allow components to make changes when certain events take place. + +Moodle supports a feature known as _ [Event observers](https://docs.moodle.org/dev/Events_API#Event_observers) _ to allow components to make changes when certain events take place. The `db/events.php` file allows you define any event subscriptions that your plugin needs to listen for. diff --git a/docs/apis/_files/db-install-php.mdx b/docs/apis/_files/db-install-php.mdx index 4e541c02cc..e91709f741 100644 --- a/docs/apis/_files/db-install-php.mdx +++ b/docs/apis/_files/db-install-php.mdx @@ -1,3 +1,4 @@ + The `db/install.php` file allows you define a post-installation hook, which is called immediately after the initial creation of your database schema. :::caution diff --git a/docs/apis/_files/db-install-xml.mdx b/docs/apis/_files/db-install-xml.mdx index b780ef5dbc..4af56d4989 100644 --- a/docs/apis/_files/db-install-xml.mdx +++ b/docs/apis/_files/db-install-xml.mdx @@ -1,7 +1,8 @@ -The `install.xml` file is used to define any database tables, fields, indexes, and keys, which should be created for a plugin during its initial insatllation. + +The `install.xml` file is used to define any database tables, fields, indexes, and keys, which should be created for a plugin during its initial installation. :::caution -When creating or updating the `install.xml` you **must** use the built-in [[XMLDB Documentation|XMLDB editor]] within Moodle. +When creating or updating the `install.xml` you **must** use the built-in [XMLDB editor](https://docs.moodle.org/dev/XMLDB_Documentation) within Moodle. -::: \ No newline at end of file +::: diff --git a/docs/apis/_files/db-messages-php.mdx b/docs/apis/_files/db-messages-php.mdx index a25763bf59..000225f1dc 100644 --- a/docs/apis/_files/db-messages-php.mdx +++ b/docs/apis/_files/db-messages-php.mdx @@ -1,3 +1,4 @@ + The `db/messages.php` file allows you to declare the messages that your plugin sends. -See the [[Message API]] documentation for further information. +See the [Message API](https://docs.moodle.org/dev/Message_API) documentation for further information. diff --git a/docs/apis/_files/db-mobile-php.mdx b/docs/apis/_files/db-mobile-php.mdx index da4737a998..8fb9607961 100644 --- a/docs/apis/_files/db-mobile-php.mdx +++ b/docs/apis/_files/db-mobile-php.mdx @@ -1,3 +1,4 @@ + The Moodle Mobile remote add-on is the mobile app version of the plugin that will be loaded when a user accesses the plugin on the app. A plugin can include several Mobile add-ons. Each add-on must indicate a unique name. diff --git a/docs/apis/_files/db-renamedclasses-php.mdx b/docs/apis/_files/db-renamedclasses-php.mdx index 61282e2a53..fa1ac64db0 100644 --- a/docs/apis/_files/db-renamedclasses-php.mdx +++ b/docs/apis/_files/db-renamedclasses-php.mdx @@ -1 +1,2 @@ + Details of classes that have been renamed to fit in with autoloading. See [forum discussion](https://moodle.org/mod/forum/discuss.php?d=262403) for details. diff --git a/docs/apis/_files/db-services-php.mdx b/docs/apis/_files/db-services-php.mdx index a07785e11b..7f4384fbb7 100644 --- a/docs/apis/_files/db-services-php.mdx +++ b/docs/apis/_files/db-services-php.mdx @@ -1,14 +1,15 @@ + The `db/services.php` file is used to describe the external functions available for use in web services. This includes -web service functions defined for javascript, and for the [[Moodle Mobile App]]. +web service functions defined for javascript, and for the [Moodle Mobile App](https://docs.moodle.org/dev/Moodle_Mobile_App). :::note -Web services should be named following the [[Web_service_API_functions#Naming_convention|naming convention for web services]]. +Web services should be named following the [naming convention for web services](https://docs.moodle.org/dev/Web_service_API_functions#Naming_convention). ::: For further information on external functions and web services, see: -- [[Adding a web service to a plugin]] -- [[Web services API]] -- [[External functions API]] +- [Adding a web service to a plugin](https://docs.moodle.org/dev/Adding_a_web_service_to_a_plugin) +- [Web services API](https://docs.moodle.org/dev/Web_services_API) +- [External functions API](https://docs.moodle.org/dev/External_functions_API) diff --git a/docs/apis/_files/db-uninstall-php.mdx b/docs/apis/_files/db-uninstall-php.mdx index ee987f8dba..5ed3089e4b 100644 --- a/docs/apis/_files/db-uninstall-php.mdx +++ b/docs/apis/_files/db-uninstall-php.mdx @@ -1 +1,2 @@ + The `db/uninstall.php` file allows you define a pre-uninstallation hook, which is called immediately before all table and data from your plugin are removed. diff --git a/docs/apis/_files/db-upgrade-php.mdx b/docs/apis/_files/db-upgrade-php.mdx index b30e840b3d..7987d65bb7 100644 --- a/docs/apis/_files/db-upgrade-php.mdx +++ b/docs/apis/_files/db-upgrade-php.mdx @@ -1,10 +1,11 @@ + The `db/upgrade.php` file contains upgrade steps, including database schema changes, changes to settings, and other steps which must be performed during upgrade. -See the [[Upgrade API]] documentation for further information. +See the [Upgrade API](https://docs.moodle.org/dev/Upgrade_API) documentation for further information. :::danger Generating Database Schema changes -When making changes to the database schema you **must** use the build-in [[XMLDB Documentation|XMDLB editor]] within +When making changes to the database schema you **must** use the build-in [XMLDB editor](https://docs.moodle.org/dev/XMLDB_Documentation) within Moodle. This can be used to generate php upgrade steps. The [install.xml](#dbinstallxml) schema must match the schema generated by the upgrade at all times. @@ -13,7 +14,7 @@ The [install.xml](#dbinstallxml) schema must match the schema generated by the u To create an upgrade step you must: -1. Use the [[XMLDB_editor]] to create the definition of the new fields +1. Use the [XMLDB editor](https://docs.moodle.org/dev/XMLDB_editor) to create the definition of the new fields 1. Update the `install.xml` from the XMLDB editor 1. Generate the PHP upgrade steps from within the XMLDB Editor 1. Update the version number in your `version.php` @@ -26,4 +27,4 @@ In many cases you will be able to combine multiple upgrade steps into a single v When a version number increment is detected during an upgrade, the `xmldb_[pluginname]_upgrade` function is called with the old version number as the first argument. -See the [[Upgrade API]] documentation for more information on the upgrade process. +See the [Upgrade API](https://docs.moodle.org/dev/Upgrade_API) documentation for more information on the upgrade process. diff --git a/docs/apis/_files/environment-xml.mdx b/docs/apis/_files/environment-xml.mdx index c1682ad23c..62af6b1660 100644 --- a/docs/apis/_files/environment-xml.mdx +++ b/docs/apis/_files/environment-xml.mdx @@ -1,3 +1,4 @@ + A plugin can declare its own environment requirements, in addition to those declared by Moodle core. These may includes features such as PHP extension requirements, version requirements, and similar items. -Further information on this file and its format can be found in the [[Environment checking]] documentation. +Further information on this file and its format can be found in the [Environment checking](https://docs.moodle.org/dev/Environment_checking) documentation. diff --git a/docs/apis/_files/lib.mdx b/docs/apis/_files/lib.mdx index 22ee0927ae..c6a7a4f9e3 100644 --- a/docs/apis/_files/lib.mdx +++ b/docs/apis/_files/lib.mdx @@ -1,4 +1,6 @@ -The `lib.php` file is a legacy file which acts as a bridge between Moodle core, and the plugin. In recent plugins it is should only used to define callbacks and related functionality which currenltly is not supported as an autoloadable class. + + +The `lib.php` file is a legacy file which acts as a bridge between Moodle core, and the plugin. In recent plugins it is should only used to define callbacks and related functionality which currently is not supported as an auto-loadable class. All functions defined in this file **must** meet the requirements set out in the relevant section of the [Coding style](/general/development/policies/codingstyle#Functions-and-Methods). diff --git a/docs/apis/_files/locallib.mdx b/docs/apis/_files/locallib.mdx index af0fd4d413..524ce83ac8 100644 --- a/docs/apis/_files/locallib.mdx +++ b/docs/apis/_files/locallib.mdx @@ -1,3 +1,6 @@ + + + :::caution Legacy feature The use of this file is no longer recommended, and new uses of it will not be permitted in core code. diff --git a/docs/apis/_files/pix-dir.mdx b/docs/apis/_files/pix-dir.mdx index bc92ae6869..f58f9c6fee 100644 --- a/docs/apis/_files/pix-dir.mdx +++ b/docs/apis/_files/pix-dir.mdx @@ -1,5 +1,6 @@ + Plugins can provide icons in several formats, and most plugin types require that a default icon be provided. Where a browser supports it, the `svg` format is used, falling back to `png` formats when an SVG is unavailable. -Full details of the correct naming, sizing, and design guidelines for icons in Moodle can be found in the [[Moodle icons]] documentation. +Full details of the correct naming, sizing, and design guidelines for icons in Moodle can be found in the [Moodle icons](https://docs.moodle.org/dev/Moodle_icons) documentation. diff --git a/docs/apis/_files/readme.mdx b/docs/apis/_files/readme.mdx index 05884816fd..185121a363 100644 --- a/docs/apis/_files/readme.mdx +++ b/docs/apis/_files/readme.mdx @@ -1,3 +1,4 @@ -We recommend that you include any additional information for your plugin in a project readme file. Ideally this should act as an offline version of all information in your plugin's page in the [[Plugins directory]]. + +We recommend that you include any additional information for your plugin in a project readme file. Ideally this should act as an offline version of all information in your plugin's page in the [Plugins directory](https://docs.moodle.org/dev/Plugins_directory). We recommend creating your readme file in either a `README.md`, or `README.txt` format. diff --git a/docs/apis/_files/readme_moodle-txt.mdx b/docs/apis/_files/readme_moodle-txt.mdx index ca06dc1340..ed589cbfd4 100644 --- a/docs/apis/_files/readme_moodle-txt.mdx +++ b/docs/apis/_files/readme_moodle-txt.mdx @@ -1,3 +1,4 @@ + When importing a third-party library into your plugin, it is advisable to create a `readme_moodle.txt` file detailing relevant information, including: - Download URLs diff --git a/docs/apis/_files/settings-php.mdx b/docs/apis/_files/settings-php.mdx index 317d815f67..c60ba5155f 100644 --- a/docs/apis/_files/settings-php.mdx +++ b/docs/apis/_files/settings-php.mdx @@ -1,3 +1,4 @@ + You can define settings for your plugin that the administrator can configure by creating a `settings.php` file in the root of your plugins' directory. :::caution @@ -12,4 +13,4 @@ By following the correct naming, all settings will automatically be stored in th ::: -Full details on how to create settings are available in the [[Admin settings]] documentation. +Full details on how to create settings are available in the [Admin settings](https://docs.moodle.org/dev/Admin_settings) documentation. diff --git a/docs/apis/_files/styles-css.mdx b/docs/apis/_files/styles-css.mdx index ae485b2fab..e62a0dd592 100644 --- a/docs/apis/_files/styles-css.mdx +++ b/docs/apis/_files/styles-css.mdx @@ -1,7 +1,8 @@ + Plugins may define a '/styles.css' to provide plugin-specific styling. See the following for further documentation: -- [[Plugin contribution checklist#CSS styles]] -- [[CSS Coding Style]] +- [Plugin contribution checklist#CSS styles](https://docs.moodle.org/dev/Plugin_contribution_checklist#CSS_styles) +- [CSS Coding Style](https://docs.moodle.org/dev/CSS_Coding_Style) :::tip Avoid custom styles where possible diff --git a/docs/apis/_files/thirdpartylibs-xml.mdx b/docs/apis/_files/thirdpartylibs-xml.mdx index d77439de86..301dde8126 100644 --- a/docs/apis/_files/thirdpartylibs-xml.mdx +++ b/docs/apis/_files/thirdpartylibs-xml.mdx @@ -1,3 +1,4 @@ + Details of all third-party libraries should be declared in the `thirdpartylibs.xml` file. This information is used to generate ignore file configuration for linting tools. For Moodle core it is also used to generate library information as part of release notes and credits. @@ -10,4 +11,4 @@ The license of any third-party code included in your plugin, and within the `thi ::: -See the [[Third_Party_Libraries]] documentation for further information. +See the [Third Party Libraries](https://docs.moodle.org/dev/Third_Party_Libraries) documentation for further information. diff --git a/docs/apis/_files/upgrade-php.mdx b/docs/apis/_files/upgrade-php.mdx index c74152fbec..7761c999c5 100644 --- a/docs/apis/_files/upgrade-php.mdx +++ b/docs/apis/_files/upgrade-php.mdx @@ -1,10 +1,11 @@ + The `db/upgrade.php` file contains upgrade steps, including database schema changes, changes to settings, and other steps which must be performed during upgrade. -See the [[Upgrade API]] documentation for further information. +See the [Upgrade API](https://docs.moodle.org/dev/Upgrade_API) documentation for further information. :::danger Generating Database Schema changes -When making changes to the database schema you **must** use the build-in [[XMLDB Documentation|XMDLB editor]] within +When making changes to the database schema you **must** use the build-in [XMLDB editor](https://docs.moodle.org/dev/XMLDB_Documentation) within Moodle. This can be used to generate php upgrade steps. The [install.xml](#dbinstallxml) schema must match the schema generated by the upgrade at all times. diff --git a/docs/apis/_files/version-php.mdx b/docs/apis/_files/version-php.mdx index 43f364863f..23c9c7847a 100644 --- a/docs/apis/_files/version-php.mdx +++ b/docs/apis/_files/version-php.mdx @@ -1,3 +1,4 @@ + The version.php contains metadata about the plugin. It is used during the installation and upgrade of the plugin. diff --git a/docs/apis/_files/yui-dir.mdx b/docs/apis/_files/yui-dir.mdx index 94709e6a24..b18721c101 100644 --- a/docs/apis/_files/yui-dir.mdx +++ b/docs/apis/_files/yui-dir.mdx @@ -1,10 +1,11 @@ -In older versions of Moodle, JavaScript was written in the YUI format. This is being phased out in favour of [[Javascript Modules]], although some older uses still remain in Moodle core. + +In older versions of Moodle, JavaScript was written in the YUI format. This is being phased out in favour of [Javascript Modules](https://docs.moodle.org/dev/Javascript_Modules), although some older uses still remain in Moodle core. -- [[YUI/Modules]] -- [[YUI]] +- [YUI/Modules](https://docs.moodle.org/dev/YUI/Modules) +- [YUI](https://docs.moodle.org/dev/YUI) :::caution -New YUI code will not be accepted into Moodle core, except for new plugins for the [[Atto|Atto editor]]. +New YUI code will not be accepted into Moodle core, except for new plugins for the [Atto editor](https://docs.moodle.org/dev/Atto). ::: diff --git a/docs/apis/commonfiles/index.mdx b/docs/apis/commonfiles/index.mdx index a1a098e2e2..6479c7c366 100644 --- a/docs/apis/commonfiles/index.mdx +++ b/docs/apis/commonfiles/index.mdx @@ -37,7 +37,7 @@ import { -This page describes the common files which may be present in any Moodle subsystem or [[Plugin types|plugin type]]. Some of these files are mandatory and __must__ exist within a component, whilst others are optional. +This page describes the common files which may be present in any Moodle subsystem or [plugin type](https://docs.moodle.org/dev/Plugin_types). Some of these files are mandatory and __must__ exist within a component, whilst others are optional. ### version.php @@ -147,8 +147,8 @@ import extraLangDescription from '../_files/lang-extra.md'; ## See also -- [[Moodle architecture]] - general overview of Moodle code architecture -- [[Plugin types]] - list of all supported plugin types +- [Moodle architecture](https://docs.moodle.org/dev/Moodle_architecture) - general overview of Moodle code architecture +- [Plugin types](https://docs.moodle.org/dev/Plugin_types) - list of all supported plugin types - [Moodle plugins directory](https://moodle.org/plugins/) - repository of contributed plugins for Moodle - [Moodle plugin skeleton generator](https://moodle.org/plugins/tool_pluginskel) - allows to quickly generate code skeleton for a new plugin - [Checklist for plugin contributors](https://docs.moodle.org/dev/Plugin_contribution_checklist) - read before submitting a plugin diff --git a/docs/apis/plugintypes/antivirus/_files/scanner-php.mdx b/docs/apis/plugintypes/antivirus/_files/scanner-php.mdx index acbcdaf789..0b614a3177 100644 --- a/docs/apis/plugintypes/antivirus/_files/scanner-php.mdx +++ b/docs/apis/plugintypes/antivirus/_files/scanner-php.mdx @@ -1,3 +1,6 @@ + + + The `classes/scanner.php` class must be defined in the correct namespace for your plugin, and must extend the `\core\antivirus\scanner` class. It is responsible for implementing the interface between Moodle and the antivirus scanning tool. diff --git a/docs/apis/plugintypes/antivirus/index.mdx b/docs/apis/plugintypes/antivirus/index.mdx index c4112bf8cd..f1d8bb8471 100644 --- a/docs/apis/plugintypes/antivirus/index.mdx +++ b/docs/apis/plugintypes/antivirus/index.mdx @@ -6,6 +6,9 @@ tags: description: Integrate your preferred Antivirus tool to with Moodle to automatically check new file uploads. --- + + + import { Since } from '@site/src/components'; Some of the important files for the antivirus plugintype are described below. See the [common plugin files](../commonfiles) documentation for details of other files which may be useful in your plugin. @@ -80,7 +84,6 @@ if ($ADMIN->fulltree) { example={settingsExample} /> - ### lang/en/antivirus_scanmyfile.php export const langExample = ` diff --git a/docs/apis/plugintypes/mod/_files/index-php.mdx b/docs/apis/plugintypes/mod/_files/index-php.mdx index d6e479d814..1ab22546c9 100644 --- a/docs/apis/plugintypes/mod/_files/index-php.mdx +++ b/docs/apis/plugintypes/mod/_files/index-php.mdx @@ -1 +1,2 @@ + The `index.php` should be used to list all instances of an activity that the current user has access to in the specified course. diff --git a/docs/apis/plugintypes/mod/_files/mod_form-php.mdx b/docs/apis/plugintypes/mod/_files/mod_form-php.mdx index b69962ec26..c2bdec2fd8 100644 --- a/docs/apis/plugintypes/mod/_files/mod_form-php.mdx +++ b/docs/apis/plugintypes/mod/_files/mod_form-php.mdx @@ -1,3 +1,4 @@ + This file is used when adding/editing a module to a course. It contains the elements that will be displayed on the form responsible for creating/installing an instance of your module. The class in the file should be called `mod_[modname]_mod_form`. :::warning diff --git a/docs/apis/plugintypes/mod/_files/view-php.mdx b/docs/apis/plugintypes/mod/_files/view-php.mdx index 84e411ee94..96567c5f4a 100644 --- a/docs/apis/plugintypes/mod/_files/view-php.mdx +++ b/docs/apis/plugintypes/mod/_files/view-php.mdx @@ -1 +1,2 @@ + Moodle will automatically generate links to view the activity using the `/view.php` page and passing in an `id` value. The `id` passed is the course module ID, which can be used to fetch all remaining data for the activity instance. diff --git a/docs/apis/plugintypes/mod/index.mdx b/docs/apis/plugintypes/mod/index.mdx index 7eebb7f3ed..b473a7844d 100644 --- a/docs/apis/plugintypes/mod/index.mdx +++ b/docs/apis/plugintypes/mod/index.mdx @@ -187,7 +187,7 @@ Granting the view capability to archetypes like `guest` does not allow any user ::: -For further information on what each attribute in that capabilities array means visit [[NEWMODULE_Adding_capabilities]]. +For further information on what each attribute in that capabilities array means visit [NEWMODULE Adding capabilities](https://docs.moodle.org/dev/NEWMODULE_Adding_capabilities). } @@ -250,7 +250,7 @@ also _required_: extraDescription={
-See the [[NEWMODULE Documentation#lib.php]] for details on the list of the functions which can be specified in `lib.php`. +See the [NEWMODULE Documentation#lib.php](https://docs.moodle.org/dev/NEWMODULE_Documentation#lib.php) for details on the list of the functions which can be specified in `lib.php`. For an Activity, you _must_ define the following three functions, which are described below: @@ -295,4 +295,4 @@ The `lib.php` file is one of the older parts of Moodle and functionality is grad ## See also -- [[NEWMODULE_Documentation]] +- [NEWMODULE Documentation](https://docs.moodle.org/dev/NEWMODULE_Documentation) diff --git a/general/projects/api/amos.md b/general/projects/api/amos.md index 7a6faa7dab..b084584583 100644 --- a/general/projects/api/amos.md +++ b/general/projects/api/amos.md @@ -146,7 +146,7 @@ AMOS BEGIN AMOS END ``` -In this example, there are three instuctions to be done. The line with `MOV` ('move') command instructs AMOS to rename the string 'description' defined in workshop to the new identifier 'intro'. The second command `CPY` ('copy') orders to create new string in the workshop module with the identifier 'submission' and the value of that string shall be taken from the `$string[['submission']` in the module assignment. If such string already exists in any language, `CPY` will not replace it. The third command is used for migrating legacy HTML help files into ordinary strings. It tells AMOS to add `new $string['forumtype_hlp']` in every language, using the content of the help file `forum/forumtype.html` as the initial value. +In this example, there are three instuctions to be done. The line with `MOV` ('move') command instructs AMOS to rename the string 'description' defined in workshop to the new identifier 'intro'. The second command `CPY` ('copy') orders to create new string in the workshop module with the identifier 'submission' and the value of that string shall be taken from the `$string['submission']` in the module assignment. If such string already exists in any language, `CPY` will not replace it. The third command is used for migrating legacy HTML help files into ordinary strings. It tells AMOS to add `new $string['forumtype_hlp']` in every language, using the content of the help file `forum/forumtype.html` as the initial value. The script syntax is defined as follows. Note that amosbler keywords are case sensitive so must be upper-case. In pseudo-regexp, the valid AMOS script is defined as: diff --git a/package.json b/package.json index 5511ffa74d..9a3bb4261d 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,14 @@ "mdlint-all": "markdownlint-cli2 '{docs,general}/**/*.md' '*.md'", "mdfix": "markdownlint-cli2-fix", "mdfix-all": "markdownlint-cli2-fix '{docs,general}/**/*.md' '*.md'", + "mdxlint": "markdownlint-cli2-config .markdownlint/mdx/.markdownlint-cli2.cjs", + "mdxlint-all": "markdownlint-cli2-config .markdownlint/mdx/.markdownlint-cli2.cjs '{docs,general}/**/*.mdx' '*.mdx'", + "mdxfix": "markdownlint-cli2-config .markdownlint/mdx/fix/.markdownlint-cli2.cjs", + "mdxfix-all": "markdownlint-cli2-config .markdownlint/mdx/fix/.markdownlint-cli2.cjs '{docs,general}/**/*.mdx' '*.mdx'", "migrate": "scripts/wikimedia-fetch.js migrate", "lint": "yarn mdlint-all", "prepare": "husky install", - "spell": "cspell '*.md' '**/*.md' 'docs/*.md' 'docs/**/*.md' 'general/*.md' 'general/**/*.md'" + "spell": "cspell '*.md' '*.mdx' '**/*.md' '**/*.mdx' 'docs/*.md' 'docs/*.mdx' 'docs/**/*.md' 'docs/**/*.mdx' 'general/*.md' 'general/*.mdx' 'general/**/*.md' 'general/**/*.mdx'" }, "dependencies": { "@cmfcmf/docusaurus-search-local": "^0.10.0", diff --git a/project-words.txt b/project-words.txt index 9d90c8bd0b..8fe2842b69 100644 --- a/project-words.txt +++ b/project-words.txt @@ -129,6 +129,7 @@ lable langindex lastaccess lastruntime +locallib loglevel mainmenu manageentries @@ -185,6 +186,7 @@ protectusernames qeupgradehelper quizaccess randomsamatch +renamedclasses returntype riskbitmask ruleset @@ -209,6 +211,7 @@ tasklogs temptables themers thirdparty +thirdpartylibs tinymce todos toggleall @@ -232,3 +235,4 @@ workshopform wwwroot xcodeproj xcworkspace +xmldb