mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-29 00:30:05 +02:00
Enabled code highlighting in READMEs via highlight.js
This commit is contained in:
@@ -19,6 +19,9 @@ const app = new Vue({
|
||||
}
|
||||
});
|
||||
|
||||
let hljs = require('highlight.js');
|
||||
hljs.initHighlightingOnLoad();
|
||||
|
||||
let link = document.getElementById('scroll-to-top');
|
||||
window.addEventListener('scroll', function() {
|
||||
if (window.scrollY > 10) {
|
||||
|
@@ -9,6 +9,9 @@ $fa-font-path: "./webfonts";
|
||||
@import "~@fortawesome/fontawesome-free/scss/brands.scss";
|
||||
@import "~@fortawesome/fontawesome-free/scss/solid.scss";
|
||||
|
||||
// Code highlighting
|
||||
@import "~highlight.js/scss/github.scss";
|
||||
|
||||
// Fonts
|
||||
@import url("https://fonts.googleapis.com/css?family=Source+Code+Pro|Work+Sans:200,400&display=swap");
|
||||
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@@ -4926,6 +4926,11 @@
|
||||
"integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==",
|
||||
"dev": true
|
||||
},
|
||||
"highlight.js": {
|
||||
"version": "9.18.1",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.1.tgz",
|
||||
"integrity": "sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg=="
|
||||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
|
@@ -11,6 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"highlight.js": "^9.18.1",
|
||||
"vue": "^2.6.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@@ -26,7 +26,7 @@ mix.purgeCss({
|
||||
extensions: ['html', 'js', 'php', 'scss', 'twig', 'vue'],
|
||||
folders: ['app'],
|
||||
whitelist: ['html', 'body', 'main', 'fab', 'far', 'fas'],
|
||||
whitelistPatterns: [/^fa\-/]
|
||||
whitelistPatterns: [/^fa\-/, /^hljs/]
|
||||
});
|
||||
|
||||
if (mix.inProduction()) {
|
||||
|
Reference in New Issue
Block a user