diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 3281a9cf70b..e3ff8e4e763 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -6,6 +6,6 @@ Reference api/hooks/index api/hooks/catalog - patches + patches/index cli/index indexes diff --git a/docs/reference/patches.rst b/docs/reference/patches/catalog.rst similarity index 100% rename from docs/reference/patches.rst rename to docs/reference/patches/catalog.rst diff --git a/docs/reference/patches/index.rst b/docs/reference/patches/index.rst new file mode 100644 index 00000000000..ae7794ff8e4 --- /dev/null +++ b/docs/reference/patches/index.rst @@ -0,0 +1,26 @@ +========== +Patches +========== + +Patches are mechanisms that Tutor offers to plugin developers to modify the templates rendered to alter our environment. In many places, the Tutor templates include calls to ``{{ patch("patchname") }}``. Plugins can add content in these places with ``hooks.Filters.ENV_PATCHES.add_item``. + +Example:: + + from tutor import hooks + + hooks.Filters.ENV_PATCHES.add_item( + ( + "openedx-lms-common-settings", + "FEATURES['ALLOW_PUBLIC_ACCOUNT_CREATION'] = False" + ) + ) + +This will add ``FEATURES['ALLOW_PUBLIC_ACCOUNT_CREATION'] = False`` to the lms common settings with a Python Tutor plugin. + +.. note:: If you want a Package Tutor plugin, we recommend you to use the `overhangio/cookiecutter-tutor-plugin `_ and add in the patches directory a file with the name of the patch, and inside the file add the content you want to add to the templates that use that patch. + +You can find a list of all patches used across Tutor here: +.. toctree:: + :maxdepth: 1 + + catalog \ No newline at end of file