aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/Resources/static/themes/_global/index.js4
-rw-r--r--app/Resources/static/themes/_global/js/highlight.js8
-rw-r--r--package.json1
3 files changed, 12 insertions, 1 deletions
diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js
index b810e5d7..ae598e56 100644
--- a/app/Resources/static/themes/_global/index.js
+++ b/app/Resources/static/themes/_global/index.js
@@ -13,8 +13,10 @@ import './global.scss';
13import './js/shortcuts/entry'; 13import './js/shortcuts/entry';
14import './js/shortcuts/main'; 14import './js/shortcuts/main';
15 15
16import { savePercent, retrievePercent } from './js/tools'; 16/* Hightlight */
17import './js/highlight';
17 18
19import { savePercent, retrievePercent } from './js/tools';
18 20
19/* ========================================================================== 21/* ==========================================================================
20 Annotations & Remember position 22 Annotations & Remember position
diff --git a/app/Resources/static/themes/_global/js/highlight.js b/app/Resources/static/themes/_global/js/highlight.js
new file mode 100644
index 00000000..4025fc14
--- /dev/null
+++ b/app/Resources/static/themes/_global/js/highlight.js
@@ -0,0 +1,8 @@
1import 'highlight.js/styles/atom-one-light.css';
2import * as hljs from 'highlight.js';
3
4window.addEventListener('load', () => {
5 document.querySelectorAll('pre').forEach((node) => {
6 hljs.highlightBlock(node);
7 });
8});
diff --git a/package.json b/package.json
index e6659bd3..8d856bbb 100644
--- a/package.json
+++ b/package.json
@@ -65,6 +65,7 @@
65 "dependencies": { 65 "dependencies": {
66 "annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85", 66 "annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85",
67 "hammerjs": "^2.0.8", 67 "hammerjs": "^2.0.8",
68 "highlight.js": "^9.12.0",
68 "icomoon-free-npm": "^0.0.0", 69 "icomoon-free-npm": "^0.0.0",
69 "jquery": "^2.1.4", 70 "jquery": "^2.1.4",
70 "jquery.cookie": "^1.4.1", 71 "jquery.cookie": "^1.4.1",