-
-
Notifications
You must be signed in to change notification settings - Fork 576
Extensions
Jakub T. Jankiewicz edited this page Nov 29, 2019
·
10 revisions
If you want to have less like command, you can use an additional file:
https://unpkg.com/[email protected]/js/less.js
This add a new jQuery plugin that can be invoked on Terminal instance, which is also a jQuery Object.
$('body').terminal({
less: function(file) {
$.get(file, (text) => this.less(text));
}
});This example shows how to invoke less with any syntax highlighting you have. If you don't want to have formatting but only for less, then you should not use the function syntax but use the function $.terminal.prism:
$('body').terminal({
less: function(file) {
var language = {html: 'website': js: 'javascript', css: 'css'};
var ext = file.match(/\.([^.]+)$/)[1];
$.get(file, (text) => this.less($.terminal.prism(language[ext], text)));
}
});On Systems that don't support emoji on system level (like Windows 10).
Library for Web-Based Terminal in JavaScript, (jQuery Terminal: git repo)
Copyright (c) 2011-2023 Jakub T. Jankiewicz