You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: brand-sample/README.md
+64-35Lines changed: 64 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,19 +10,71 @@
10
10
11
11
## Using this brand package
12
12
13
+
Here are 4 different approaches to using this brand package.
14
+
13
15
> [!IMPORTANT]
14
-
> These instructions assume you have a [tutor](https://docs.tutor.edly.io/index.html)environment that supports design tokens
16
+
> These instructions assume that you have an Open edX environment that supports design tokens:
15
17
> ***Paragon >= 23**
16
-
> ***Open edX "Teak" release or later (Tutor >= 20)**
17
-
> ***Tutor >= 20**
18
+
> ***Open edX "Teak" release or later**
19
+
> * A provisioned Open edX dev environment, either:
20
+
> ***Tutor >= 20**
21
+
> * A "bare-metal" setup
22
+
23
+
### Local brand dev using Tutor + Tutor Paragon Plugin
24
+
25
+
This will allow you to hack on the brand, recompile it, and preview it in your local Tutor instance.
26
+
27
+
First, set up the [Tutor Paragon Plugin](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon), which will reproducibly compile and serve brands for you:
# With this built, the 'tutor local do paragon-build-tokens' command becomes available.
36
+
tutor images build paragon-builder
20
37
21
-
#### Using the [`jsdelivr`](https://www.jsdelivr.com/) CDN (Recommended)
38
+
# Ensure MFE container is running if it isn't already.
39
+
# The MFE image will serve the CSS that you compile with paragon-build-tokens.
40
+
tutor dev start -d lms cms mfe
41
+
```
42
+
43
+
Every time you edit a theme, you will need to copy it into your tutor root and re-run paragon-build-tokens. You can do so by running the following from the root of the sample-plugin repository:
22
44
23
-
1. Stop `tutor` (`tutor dev stop` or `tutor local stop`)
24
-
2. Navigate to your local tutor plugins directory (`tutor plugins printroot`)
25
-
3. Create a new `sample-jsdelivr.py` plugin file with the following content
||echo'Could not copy design token sources into tutor environment :('
53
+
```
54
+
55
+
Note: If you are having issues building the tokens, check the contents of the paragon plugin folder within your tutor root. It should look like this:
56
+
57
+
```bash
58
+
tree "$(tutor config printroot)/env/plugins/paragon"
59
+
├── [...]
60
+
└── theme-sources
61
+
└── themes
62
+
└── light
63
+
└── global
64
+
└── color.json
65
+
```
66
+
67
+
### Local brand dev without Tutor
68
+
69
+
TODO write this section
70
+
71
+
### jsdeliver + Tutor
72
+
73
+
*tutor-contrib-sample ships with this approach, for your convenience.*
74
+
75
+
This configures Tutor so that your frontend loads the brand-sample from the [`jsdelivr`](https://www.jsdelivr.com/) CDN. It assumes that the brand exists on GitHub. This does not support local brand development.
76
+
77
+
Add this to a tutor plugin, and then enable the plugin and restart tutor:
4. Enable the plugin (`tutor plugins enable sample-jsdelivr`)
55
-
5. Start `tutor` (`tutor dev start lms cms mfe` or `tutor local start lms cms mfe`)
56
-
57
-
#### Using the [Tutor Paragon Plugin](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon) (Recommended)
58
-
59
-
1.[Install](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#installation) and [enable](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#enable-the-plugin) the Tutor Paragon Plugin (`tutor-contrib-paragon`)
60
-
2.[Build](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#build-the-paragon-image) the `paragon-builder` image.
61
-
2. Navigate to your Tutor config directory (you can find this by running `tutor config printroot`)
62
-
3. From your config directory, navigate to `env/plugins/paragon` (the full path on my dev machine is `~/.local/share/tutor-main/env/plugins/paragon`)
63
-
4. You should see some directories in there, find the `theme-sources` directory.
64
-
5. Place this theme's [`color.json` file](./tokens/src/themes/light/global/color.json) in the appropriate subdirectory of the `theme-sources` directory.
65
-
```sh
66
-
$ tree ~/.local/share/tutor-main/env/plugins/paragon
67
-
├── [...]
68
-
└── theme-sources
69
-
└── themes
70
-
└── light
71
-
└── global
72
-
└── color.json
73
-
```
74
-
6.[Build](https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon#build-all-themes) the theme
75
-
7. Start `tutor` (`tutor dev start lms cms mfe` or `tutor local start lms cms mfe`)
106
+
### jsdeliver without Tutor
76
107
77
-
### ***OR*** manually add to an MFE's `env.config.js(x)`
78
-
Minimal `env.config.js` to install this theme
108
+
Within each MFE, configure its `env.config.js[x]` to install this theme:
79
109
80
110
```js
81
111
constconfig= {
@@ -94,8 +124,7 @@ const config = {
94
124
exportdefaultconfig;
95
125
```
96
126
97
-
### ***OR*** manually add to a `frontend-base` site's `site.config.tsx`
98
-
Add the following block to your `SiteConfig` object in `site.config.tsx`
127
+
If you are running a frontend-base site, add to the `SiteConfig` object in your `site.config.ts[x]`:
0 commit comments