Skip to content

Commit 5c347cb

Browse files
authored
docs: improve formatting for GitHub compatibility and clarity
1 parent 24bec46 commit 5c347cb

File tree

1 file changed

+72
-39
lines changed

1 file changed

+72
-39
lines changed

plugins/tutor-contrib-paragon/README.rst

Lines changed: 72 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,29 @@ To use this plugin, ensure you're running compatible versions of Open edX and it
5252
* **Open edX "Teak" release (Tutor >= 20)**
5353
* **Tutor >= 20**
5454

55-
.. note::
55+
**💡 Note:**
56+
Design token functionality is available starting from Paragon v23 and the Open edX "Teak" release.
57+
While the plugin is expected to support future versions (e.g., Tutor 21+), major releases may introduce breaking changes.
5658

57-
Design token functionality is available starting from Paragon version 23 and the Open edX "Teak" release (which corresponds to Tutor version 20). While the plugin is expected to support future versions (e.g., Tutor 21+), major releases may introduce breaking changes. Compatibility will be updated as needed.
5859

59-
.. warning::
6060

61-
As of now, the plugin's `pyproject.toml` specifies `tutor>=19.0.0,<21.0.0`. This constraint may be relaxed once upstream changes in `tutor-mfe` are released (see `overhangio/tutor-mfe#267 <https://github.com/overhangio/tutor-mfe/pull/267>`_ and `overhangio/tutor-mfe#264 <https://github.com/overhangio/tutor-mfe/pull/264>`_).
61+
**⚠️ Warning:**
62+
As of now, the plugin's `pyproject.toml` specifies:
63+
64+
::
65+
66+
tutor>=19.0.0,<21.0.0
67+
68+
This constraint may be relaxed once upstream changes in `tutor-mfe` are released:
69+
* https://github.com/overhangio/tutor-mfe/pull/267
70+
* https://github.com/overhangio/tutor-mfe/pull/264
71+
6272

6373
Installation
6474
============
6575

66-
.. note::
67-
A future version may be available via PyPI. For now, use the development installation method.
76+
**💡 Note:**
77+
A future version may be available via PyPI. For now, use the development installation method.
6878

6979
Development Install
7080
-------------------
@@ -238,14 +248,18 @@ Ways to use shared base styles:
238248
Option 1: Use jsDelivr CDN
239249
--------------------------
240250

241-
You can configure your MFEs to load base Paragon styles directly from the jsDelivr CDN. This is often the simplest approach.
251+
You can configure your MFEs to load base Paragon styles directly from the `jsDelivr CDN <https://www.jsdelivr.com/>`_. This is often the simplest approach.
252+
253+
Configure your MFE settings (likely via ``MFE_CONFIG`` in Tutor) to use the jsDelivr URL for the base styles. You can use the ``$paragonVersion`` wildcard to ensure the MFE loads the correct version dynamically.
254+
255+
* Example URL using the wildcard::
242256

243-
1. Determine the ``@openedx/paragon`` version used by your MFEs (e.g., by checking the MFE's ``package.json`` or running ``npm list @openedx/paragon`` within an MFE directory).
244-
2. Configure your MFE settings (likely via ``MFE_CONFIG`` in Tutor) to use the jsDelivr URL for the base styles.
245-
* Example URL: ``https://cdn.jsdelivr.net/npm/@openedx/[email protected]/dist/core.min.css``
246-
* (Replace ``23.1.0`` with the actual version used by your MFEs).
257+
``https://cdn.jsdelivr.net/npm/@openedx/paragon@$paragonVersion/dist/core.min.css``
258+
* (Alternatively, you can specify a fixed version like ``23.1.0`` if needed::
247259

248-
.. note::
260+
``https://cdn.jsdelivr.net/npm/@openedx/[email protected]/dist/core.min.css``
261+
262+
**💡 Note:**
249263
Using jsDelivr involves loading resources from an external CDN. Consider network policies and data privacy requirements before implementing this approach.
250264

251265
Option 2: Host Your Own Base Styles
@@ -254,33 +268,52 @@ Option 2: Host Your Own Base Styles
254268
You can host the base Paragon styles yourself using this plugin's static file hosting capability (via ``MFE_HOST_EXTRA_FILES``).
255269

256270
1. Obtain the base Paragon CSS file (typically ``core.min.css``) for the version(s) used by your MFEs.
257-
2. Place the base CSS file(s) into your ``PARAGON_THEMES_PATH`` directory. A common structure might be:
258-
.. code-block:: text
259-
260-
{{ TUTOR_ROOT }}/env/plugins/paragon/themes/
261-
└── core/
262-
└── 23.1.0/ # Use the actual Paragon version
263-
└── core.min.css
264-
265-
3. Configure your MFEs to load the base styles from the plugin's static URL.
266-
* Example URL (based on the structure above): ``http://<your-lms-domain>/static/paragon/themes/core/23.1.0/core.min.css``
267-
* Replace ``<your-lms-domain>`` with your actual LMS domain (e.g., ``apps.local.openedx.io``).
268-
* Update your MFE configuration (for example, by setting ``MFE_CONFIG["PARAGON_THEME_URLS"]`` in your Tutor settings) to point to this URL. **This URL must be placed under the ``"default"`` key within the ``"core"`` section.**
269-
* Example configuration snippet:
270-
271-
.. code-block:: python
272-
273-
MFE_CONFIG["PARAGON_THEME_URLS"] = {
274-
"core": {
275-
"urls": {
276-
"default": "http://<your-lms-domain>/static/paragon/themes/core/23.1.0/core.min.css"
277-
},
278-
},
279-
# ... other configurations for variants
280-
}
281-
282-
.. note::
283-
When hosting your own base styles, ensure the versions match those expected by your MFEs. Using a single, compatible version (e.g., the latest minor of the major version used) is often sufficient if you are using standard MFEs from the same Open edX release. For advanced configurations like version wildcards, refer to the `frontend-platform theming documentation <https://github.com/openedx/frontend-platform/blob/master/docs/how_tos/theming.md>`_.
271+
272+
**💡 Note:**
273+
MFEs within the same Open edX release typically use the same major version of Paragon, but minor versions might differ. You can check the version for an MFE by inspecting its ``package.json`` file or running ``npm list @openedx/paragon`` within an MFE directory.
274+
275+
2. Place the base CSS file(s) into your ``PARAGON_THEMES_PATH`` directory. You have two main options for structuring this:
276+
277+
* **Host a single version:** If all your MFEs can use the same version (e.g., the latest minor of a major version like ``23.4.0``), place it once::
278+
279+
{{ TUTOR_ROOT }}/env/plugins/paragon/themes/
280+
└── core/
281+
└── 23.4.0/ # A single, chosen version
282+
└── core.min.css
283+
284+
* **Host multiple versions:** To support MFEs using different Paragon versions, create a directory structure for each required version::
285+
286+
{{ TUTOR_ROOT }}/env/plugins/paragon/themes/
287+
└── core/
288+
├── 23.1.0/ # Version for MFE A
289+
│ └── core.min.css
290+
├── 23.4.0/ # Version for MFE B, C
291+
│ └── core.min.css
292+
└── ... (other versions as needed)
293+
294+
295+
3. Configure your MFEs to load the base styles from the plugin's static URL.
296+
297+
* **Using a single version (Recommended):**
298+
If you host only one version of the base styles, hardcode that version in the URL within your `MFE_CONFIG` settings.
299+
300+
Example URL::
301+
302+
http://<your-lms-domain>/static/paragon/themes/core/23.4.0/core.min.css
303+
304+
Replace `<your-lms-domain>` with your actual LMS domain (e.g., `apps.local.openedx.io`).
305+
306+
* **Using multiple versions or the wildcard:**
307+
To support MFEs using different Paragon versions, configure the URL in `MFE_CONFIG` using the `$paragonVersion` placeholder.
308+
309+
Example URL::
310+
311+
http://<your-lms-domain>/static/paragon/themes/core/$paragonVersion/core.min.css
312+
313+
Ensure all versions requested by your MFEs are present in your hosted directory structure.
314+
315+
**💡 Note:**
316+
When hosting your own base styles, ensure the versions match those expected by your MFEs. Using a single, compatible version is often sufficient for standard MFEs from the same Open edX release. For advanced configurations like version wildcards, refer to the `frontend-platform theming documentation <https://github.com/openedx/frontend-platform/blob/master/docs/how_tos/theming.md>`_.
284317

285318
Additional Resources
286319
--------------------

0 commit comments

Comments
 (0)