1 |
efrain |
1 |
Description of updating JS-Beautify and CodeMirror libraries into Moodle.
|
|
|
2 |
|
|
|
3 |
There is a build script that should automate the process of updating the libraries.
|
|
|
4 |
It is located in the build directory and is called build.sh.
|
|
|
5 |
It requires the following pre-requisites: jq, npm and npx.
|
|
|
6 |
Most Moodle LMS development systems should have at least npm and npx installed.
|
|
|
7 |
However, jq is not a common tool and may need to be installed separately.
|
|
|
8 |
|
|
|
9 |
For example, on Ubuntu you would use:
|
|
|
10 |
sudo apt-get install jq
|
|
|
11 |
|
|
|
12 |
And on macOS with Homebrew:
|
|
|
13 |
brew install jq
|
|
|
14 |
|
|
|
15 |
Once you have the pre-requisites installed, you can run the build script.
|
|
|
16 |
from the root of the plugin (e.g lib/editor/tiny/plugins/html), run:
|
|
|
17 |
./build/build.sh
|
|
|
18 |
|
|
|
19 |
Once the script has run, you should see the following files updated:
|
|
|
20 |
* lib/editor/tiny/plugins/html/amd/src/beautify/beautify.js
|
|
|
21 |
* lib/editor/tiny/plugins/html/amd/src/beautify/beautify-css.js
|
|
|
22 |
* lib/editor/tiny/plugins/html/amd/src/beautify/beautify-html.js
|
|
|
23 |
* lib/editor/tiny/plugins/html/amd/src/codemirror/codemirror-lazy.js
|
|
|
24 |
|
|
|
25 |
Next, you need to run the build script for the Moodle plugin.
|
|
|
26 |
From the root of the plugin (e.g lib/editor/tiny/plugins/html), run:
|
|
|
27 |
cd amd
|
|
|
28 |
grunt
|
|
|
29 |
|
|
|
30 |
The build.sh script should display the latest versions of the libraries in order to
|
|
|
31 |
update thirdpartylibs.xml with the new version numbers.
|
|
|
32 |
|