1 |
efrain |
1 |
Description of importing the codemirror library into Moodle.
|
|
|
2 |
|
|
|
3 |
NOTE: To make it more readable, in this explanation [LIBRARYPATH] means:
|
|
|
4 |
[PATH TO YOUR MOODLE]/lib/editor/atto/plugins/html/yui/src/codemirror
|
|
|
5 |
|
|
|
6 |
1 Download the latest codemirror code somewhere (example /tmp/cm) using:
|
|
|
7 |
|
|
|
8 |
mkdir -p codemirror/node_modules
|
|
|
9 |
npm install --prefix codemirror codemirror@5 --save-dev
|
|
|
10 |
|
|
|
11 |
Note down the version number displayed by the command, to update thirdpartylibs.xml accordingly.
|
|
|
12 |
|
|
|
13 |
2 Then copy the following files to your local Moodle directory:
|
|
|
14 |
|
|
|
15 |
[CODEMIRRORPATH] = codemirror/node_modules
|
|
|
16 |
|
|
|
17 |
cp [CODEMIRRORPATH]/codemirror/lib/codemirror.js [LIBRARYPATH]/js
|
|
|
18 |
cp [CODEMIRRORPATH]/codemirror/mode/css/css.js [LIBRARYPATH]/js
|
|
|
19 |
cp [CODEMIRRORPATH]/codemirror/mode/htmlmixed/htmlmixed.js [LIBRARYPATH]/js
|
|
|
20 |
cp [CODEMIRRORPATH]/codemirror/mode/javascript/javascript.js [LIBRARYPATH]/js
|
|
|
21 |
cp [CODEMIRRORPATH]/codemirror/mode/xml/xml.js [LIBRARYPATH]/js
|
|
|
22 |
|
|
|
23 |
3 Rebuild the module by:
|
|
|
24 |
cd [PATH TO YOUR MOODLE]/lib/editor/atto/plugins/html/yui/src/
|
|
|
25 |
grunt shifter
|
|
|
26 |
|
|
|
27 |
4 Update the version number in (using the version noted down in #1):
|
|
|
28 |
[PATH TO YOUR MOODLE]/lib/editor/atto/plugins/html/thirdpartylibs.xml
|