7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-07 08:30:48 +00:00

squash: docs: address reveiw comments

This commit is contained in:
Kyle McCormick 2022-03-04 16:48:47 -05:00 committed by Régis Behmo
parent 87f8348a01
commit 0d2d6c58e8
2 changed files with 5 additions and 15 deletions

View File

@ -1,22 +1,14 @@
Plugin API
==========
A Tutor plugin is defined either by a YAML file or a Python package.
Plugins can affect the behaviour of Tutor at multiple levels:
they can define Docker images, introduce new services, modify the settings of existing services, specify intialization processes, and more.
Plugins can achieve all this using four extension points that Tutor exposes to both YAML and Python plugins:
* :ref:`config <plugin_config>`,
* :ref:`patches <plugin_patches>`,
* :ref:`hooks <plugin_hooks>` and
* :ref:`templates <plugin_templates>`.
* Add new settings or modify existing ones in the Tutor configuration (see :ref:`config <plugin_config>`).
* Add new templates to the Tutor project environment or modify existing ones (see :ref:`patches <plugin_patches>`, :ref:`templates <plugin_templates>` and :ref:`hooks <plugin_hooks>`).
* Add custom commands to the Tutor CLI (see :ref:`command <plugin_command>`).
Additionally, Python plugins can extend Tutor's command line interface using one futher extension point:
There exists two different APIs to create Tutor plugins: either with YAML files or Python packages. YAML files are more simple to create, but are limited to just configuration and template patches.
* :ref:`command <plugin_command>`.
.. _plugin_config:
config
~~~~~~

View File

@ -14,9 +14,7 @@ YAML files that are stored in the tutor plugins root folder will be automaticall
On Linux, this points to ``~/.local/share/tutor-plugins``. The location of the plugin root folder can be modified by setting the ``TUTOR_PLUGINS_ROOT`` environment variable.
YAML plugins must define two special top-level keys: ``name`` and ``version``.
Then, YAML plugins may use four top-level keys to customize Tutor's behavior: ``config``, ``patches``, ``hooks``, and ``templates``.
Custom CLI commands are not supported by YAML plugins.
YAML plugins must define two special top-level keys: ``name`` and ``version``. Then, YAML plugins may use two more top-level keys to customize Tutor's behavior: ``config`` and ``patches``. Custom CLI commands, templates, and hooks are not supported by YAML plugins.
Let's create a simple plugin that adds your own `Google Analytics <https://analytics.google.com/>`__ tracking code to your Open edX platform. We need to add the ``GOOGLE_ANALYTICS_ACCOUNT`` and ``GOOGLE_ANALYTICS_TRACKING_ID`` settings to both the LMS and the CMS settings. To do so, we will only have to create the ``openedx-common-settings`` patch, which is shared by the development and the production settings both for the LMS and the CMS. First, create the plugin directory::