1f0372c4b5
*Total -- 939.27kb -> 798.60kb (14.98%) /smilies_adult/icons/bong.gif -- 0.96kb -> 0.19kb (80.06%) /smiley_pack/icons/animals/bunnyflowers.gif -- 6.48kb -> 1.30kb (80.02%) /smiley_pack/icons/love/inlove.gif -- 0.98kb -> 0.21kb (78.51%) /smiley_pack/icons/fantasy/dragon.gif -- 3.35kb -> 0.98kb (70.74%) /smiley_pack/icons/food/popcorn.gif -- 1.13kb -> 0.34kb (69.87%) /smiley_pack/icons/sport/tennis.gif -- 1.04kb -> 0.34kb (67.58%) /smiley_pack/icons/fantasy/dragonwhelp.gif -- 2.28kb -> 0.77kb (66.47%) /smileybutton/view/default.svg -- 3.43kb -> 1.24kb (63.78%) /smileybutton/view/vier.svg -- 3.48kb -> 1.29kb (62.95%) /smiley_pack/icons/fight/acid.gif -- 69.20kb -> 26.86kb (61.19%) /smiley_pack/icons/smoking/smoking.gif -- 2.23kb -> 0.95kb (57.56%) /smiley_pack/icons/love/loveheart.gif -- 0.64kb -> 0.28kb (56.75%) /smiley_pack/icons/animals/frog.gif -- 1.54kb -> 0.69kb (55.57%) /smiley_pack/icons/music/guitar.gif -- 2.02kb -> 0.91kb (54.88%) /smiley_pack/icons/fight/bfg.gif -- 2.21kb -> 1.01kb (54.43%) /smileybutton/view/smoothly.svg -- 4.46kb -> 2.09kb (53.16%) /smiley_pack/icons/devilangel/catdevil.gif -- 1.92kb -> 0.95kb (50.28%) /smilies_adult/icons/sperm.gif -- 2.84kb -> 1.41kb (50.28%) /smiley_pack/icons/animals/bunny.gif -- 1.45kb -> 0.72kb (50.2%) /smiley_pack/icons/tired/countsheep.gif -- 1.48kb -> 0.75kb (49.34%) /smiley_pack/icons/sport/cycling.gif -- 1.84kb -> 0.95kb (48.22%) /smiley_pack/icons/animals/sheep.gif -- 7.45kb -> 3.86kb (48.19%) /js_upload/file-uploader/client/loading.gif -- 1.65kb -> 0.88kb (46.39%) /js_upload/file-uploader/tests/sample-files/1imagelonglonglonglonglonglongname.gif -- 1.65kb -> 0.88kb (46.39%) /smiley_pack/icons/sport/snooker.gif -- 10.99kb -> 5.94kb (45.99%) /smiley_pack/icons/music/violin.gif -- 1.76kb -> 0.99kb (43.66%) /smiley_pack/icons/fight/chainsaw.gif -- 19.89kb -> 11.25kb (43.41%) /smiley_pack/icons/fight/gangs.gif -- 1.65kb -> 1.04kb (37.31%) /smiley_pack/icons/music/drums.gif -- 7.42kb -> 4.66kb (37.23%) /birdavatar/avatars/accessorie_7.png -- 7.24kb -> 4.56kb (37.05%) /smiley_pack/icons/food/broccoli.gif -- 3.93kb -> 2.62kb (33.47%) /smiley_pack/icons/sport/bowling.gif -- 3.48kb -> 2.39kb (31.39%) /smiley_pack/icons/animals/horse.gif -- 2.41kb -> 1.72kb (28.69%) /smiley_pack/icons/food/apple.gif -- 1.65kb -> 1.18kb (28.24%) /smiley_pack/icons/love/iloveyou.gif -- 15.31kb -> 11.22kb (26.71%) /smiley_pack/icons/drool/drool.gif -- 1.35kb -> 1.02kb (24.37%) /smiley_pack/icons/devilangel/saint.gif -- 1.17kb -> 0.89kb (24.23%) /smiley_pack/icons/babies/babycot.gif -- 3.37kb -> 2.61kb (22.62%) /smiley_pack/icons/animals/monkey.gif -- 4.79kb -> 3.71kb (22.42%) /smiley_pack/icons/animals/pig.gif -- 0.90kb -> 0.71kb (21.19%) /birdavatar/avatars/accessorie_17.png -- 0.38kb -> 0.31kb (19.9%) /birdavatar/avatars/accessorie_2.png -- 0.38kb -> 0.31kb (19.9%) /birdavatar/avatars/accessorie_13.png -- 0.38kb -> 0.31kb (19.9%) /birdavatar/avatars/accessorie_18.png -- 0.38kb -> 0.31kb (19.9%) /birdavatar/avatars/accessorie_20.png -- 0.38kb -> 0.31kb (19.9%) /birdavatar/avatars/accessorie_4.png -- 0.38kb -> 0.31kb (19.9%) /birdavatar/avatars/accessorie_19.png -- 0.38kb -> 0.31kb (19.9%) /birdavatar/avatars/hoop_8.png -- 0.38kb -> 0.31kb (19.9%) /smiley_pack/icons/fight/2guns.gif -- 0.79kb -> 0.64kb (19.51%) /smiley_pack/icons/sport/archery.gif -- 2.73kb -> 2.28kb (16.58%) /smiley_pack/icons/music/elvis.gif -- 1.75kb -> 1.46kb (16.27%) /smiley_pack/icons/laugh/rofl.gif -- 0.99kb -> 0.83kb (15.94%) /smiley_pack/icons/tired/yawn.gif -- 1.70kb -> 1.44kb (15.7%) /smiley_pack/icons/confused/shrug.gif -- 0.18kb -> 0.15kb (15.3%) /smiley_pack/icons/babies/pregnant.gif -- 1.47kb -> 1.26kb (14.53%) /smiley_pack/icons/animals/fish.gif -- 4.39kb -> 3.80kb (13.51%) /smiley_pack/icons/fight/viking.gif -- 9.42kb -> 8.15kb (13.5%) /smiley_pack/icons/fantasy/alienmonster.gif -- 7.46kb -> 6.46kb (13.42%) /smiley_pack/icons/cool/affro.gif -- 0.15kb -> 0.13kb (12.66%) /smiley_pack/icons/devilangel/blondedevil.gif -- 2.89kb -> 2.54kb (12.07%) /smiley_pack/icons/disgust/fartinbed.gif -- 22.74kb -> 20.01kb (12.03%) /smiley_pack/icons/devilangel/turnevil.gif -- 0.62kb -> 0.55kb (11.95%) /smiley_pack/icons/sport/golf.gif -- 2.34kb -> 2.06kb (11.88%) /smiley_pack/icons/animals/cow.gif -- 0.76kb -> 0.67kb (11.79%) /smiley_pack/icons/animals/chick.gif -- 3.58kb -> 3.17kb (11.62%) /smiley_pack/icons/devilangel/daseesaw.gif -- 6.62kb -> 5.87kb (11.34%) /smiley_pack/icons/sport/fencing.gif -- 10.98kb -> 9.76kb (11.13%) /ljpost/livejournal.png -- 3.51kb -> 3.14kb (10.63%) /smiley_pack/icons/confused/dazed.gif -- 1.58kb -> 1.42kb (10.16%) /smiley_pack/icons/fight/bowman.gif -- 1.31kb -> 1.18kb (9.95%) /smiley_pack/icons/fight/alienfight.gif -- 25.52kb -> 23.31kb (8.64%) /smiley_pack/icons/fight/samurai.gif -- 3.21kb -> 2.94kb (8.37%) /smiley_pack/icons/disgust/toilet.gif -- 8.73kb -> 8.03kb (7.96%) /smiley_pack/icons/sport/juggling.gif -- 4.19kb -> 3.86kb (7.88%) /smiley_pack/icons/animals/cat.gif -- 0.84kb -> 0.78kb (7.52%) /smilies_adult/icons/drunk.gif -- 0.31kb -> 0.29kb (7.48%) /smiley_pack/icons/fight/lasergun.gif -- 2.02kb -> 1.87kb (7.39%) /smiley_pack/icons/fight/hammersplat.gif -- 16.44kb -> 15.26kb (7.22%) /smiley_pack/icons/animals/bee.gif -- 4.40kb -> 4.08kb (7.21%) /smiley_pack/icons/devilangel/cherub.gif -- 1.58kb -> 1.46kb (7.06%) /smiley_pack/icons/sport/skipping.gif -- 0.84kb -> 0.78kb (6.98%) /smiley_pack/icons/fight/machinegun.gif -- 1.67kb -> 1.55kb (6.85%) /smiley_pack/icons/fight/sabre.gif -- 0.65kb -> 0.60kb (6.78%) /smiley_pack/icons/music/dj.gif -- 4.34kb -> 4.05kb (6.77%) /smiley_pack/icons/cool/cool.gif -- 5.02kb -> 4.71kb (6.26%) /birdavatar/avatars/accessorie_8.png -- 13.16kb -> 12.34kb (6.24%) /smiley_pack/icons/disgust/fartblush.gif -- 29.16kb -> 27.37kb (6.11%) /smiley_pack/icons/fight/marine.gif -- 5.69kb -> 5.34kb (6.11%) /smiley_pack/icons/food/fryegg.gif -- 6.34kb -> 5.97kb (5.84%) /birdavatar/avatars/wing_5.png -- 5.54kb -> 5.22kb (5.8%) /birdavatar/avatars/body_7.png -- 17.19kb -> 16.20kb (5.72%) /smiley_pack/icons/disgust/vomit.gif -- 2.66kb -> 2.51kb (5.57%) /smiley_pack/icons/food/banana.gif -- 1.51kb -> 1.43kb (5.44%) /smiley_pack/icons/sad/sigh.gif -- 0.73kb -> 0.69kb (5.08%) /smiley_pack/icons/sport/darts.gif -- 6.94kb -> 6.59kb (5.03%) /smiley_pack/icons/food/tomato.gif -- 2.57kb -> 2.45kb (4.83%) /smiley_pack/icons/fight/crossbow.gif -- 0.87kb -> 0.84kb (3.82%) /smiley_pack/icons/animals/snail.gif -- 0.63kb -> 0.61kb (3.72%) /twitter/vendor/abraham/twitteroauth/tests/kitten.jpg -- 210.64kb -> 202.94kb (3.66%) /smiley_pack/icons/sport/horseriding.gif -- 10.24kb -> 9.89kb (3.48%) /smiley_pack/icons/food/carrot.gif -- 0.57kb -> 0.55kb (3.09%) /smiley_pack/icons/fantasy/ghost.gif -- 1.03kb -> 1.00kb (2.86%) /smiley_pack/icons/sport/surfing.gif -- 1.60kb -> 1.56kb (2.68%) /smiley_pack/icons/animals/bigspider.gif -- 25.37kb -> 24.71kb (2.59%) /smiley_pack/icons/fantasy/dinosaur.gif -- 2.77kb -> 2.70kb (2.57%) /smiley_pack/icons/animals/hamster.gif -- 1.22kb -> 1.19kb (2.57%) /smiley_pack/icons/animals/dragonfly.gif -- 2.49kb -> 2.42kb (2.51%) /smiley_pack/icons/animals/dolphin.gif -- 1.54kb -> 1.51kb (2.34%) /birdavatar/avatars/tail_6.png -- 12.88kb -> 12.58kb (2.33%) /highlightjs/asset/styles/brown-papersq.png -- 17.77kb -> 17.36kb (2.32%) /smiley_pack/icons/love/love.gif -- 3.37kb -> 3.29kb (2.32%) /smiley_pack/icons/animals/dog.gif -- 5.25kb -> 5.13kb (2.22%) /birdavatar/avatars/tail_4.png -- 5.36kb -> 5.25kb (2.04%) /smiley_pack/icons/oldcore/headbang.gif -- 0.86kb -> 0.85kb (1.92%) /smiley_pack/icons/laugh/loltv.gif -- 2.28kb -> 2.25kb (1.54%) /smiley_pack/icons/animals/elephant.gif -- 0.93kb -> 0.92kb (1.47%) /smiley_pack/icons/sad/prisoner.gif -- 1.92kb -> 1.89kb (1.12%) /smiley_pack/icons/babies/stork.gif -- 18.54kb -> 18.37kb (0.94%) /smiley_pack/icons/tired/hammock.gif -- 8.12kb -> 8.05kb (0.9%) /smiley_pack/icons/animals/crab.gif -- 2.65kb -> 2.63kb (0.88%) /smiley_pack/icons/oldcore/shaka.gif -- 2.19kb -> 2.17kb (0.85%) /smiley_pack/icons/sport/football.gif -- 1.89kb -> 1.88kb (0.83%) /birdavatar/avatars/tail_2.png -- 10.09kb -> 10.02kb (0.75%) /birdavatar/avatars/eyes_1.png -- 6.67kb -> 6.62kb (0.75%) /smiley_pack/icons/food/cooking.gif -- 3.05kb -> 3.03kb (0.7%) /smiley_pack/icons/devilangel/devil.gif -- 1.95kb -> 1.94kb (0.45%) /smiley_pack/icons/love/lovebear.gif -- 4.39kb -> 4.37kb (0.31%) /smiley_pack/icons/drink/tea.gif -- 9.68kb -> 9.66kb (0.27%) /birdavatar/avatars/body_9.png -- 21.06kb -> 21.01kb (0.25%) /smiley_pack/icons/happy/tearsofjoy.gif -- 1.27kb -> 1.26kb (0.23%) /birdavatar/avatars/body_3.png -- 20.46kb -> 20.43kb (0.17%) /smiley_pack/icons/respect/hailking.gif -- 23.18kb -> 23.14kb (0.17%) /smiley_pack/icons/fight/tank.gif -- 11.19kb -> 11.18kb (0.11%) /birdavatar/avatars/accessorie_6.png -- 7.99kb -> 7.99kb (0.02%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> |
||
---|---|---|
.. | ||
styles | ||
CHANGES.md | ||
LICENSE | ||
README.md | ||
README.ru.md | ||
highlight.pack.js |
README.md
Highlight.js
Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any markup, doesn’t depend on any framework and has automatic language detection.
Getting Started
The bare minimum for using highlight.js on a web page is linking to the
library along with one of the styles and calling
initHighlightingOnLoad
:
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
This will find and highlight code inside of <pre><code>
tags; it tries
to detect the language automatically. If automatic detection doesn’t
work for you, you can specify the language in the class
attribute:
<pre><code class="html">...</code></pre>
The list of supported language classes is available in the class
reference. Classes can also be prefixed with either language-
or
lang-
.
To disable highlighting altogether use the nohighlight
class:
<pre><code class="nohighlight">...</code></pre>
Custom Initialization
When you need a bit more control over the initialization of
highlight.js, you can use the highlightBlock
and configure
functions. This allows you to control what to highlight and when.
Here’s an equivalent way to calling initHighlightingOnLoad
using
jQuery:
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
You can use any tags instead of <pre><code>
to mark up your code. If
you don't use a container that preserve line breaks you will need to
configure highlight.js to use the <br>
tag:
hljs.configure({useBR: true});
$('div.code').each(function(i, block) {
hljs.highlightBlock(block);
});
For other options refer to the documentation for configure
.
Web Workers
You can run highlighting inside a web worker to avoid freezing the browser window while dealing with very big chunks of code.
In your main script:
addEventListener('load', function() {
var code = document.querySelector('#code');
var worker = new Worker('worker.js');
worker.onmessage = function(event) { code.innerHTML = event.data; }
worker.postMessage(code.textContent);
})
In worker.js:
onmessage = function(event) {
importScripts('<path>/highlight.pack.js');
var result = self.hljs.highlightAuto(event.data);
postMessage(result.value);
}
Getting the Library
You can get highlight.js as a hosted, or custom-build, browser script or as a server module. Right out of the box the browser script supports both AMD and CommonJS, so if you wish you can use RequireJS or Browserify without having to build from source. The server module also works perfectly fine with Browserify, but there is the option to use a build specific to browsers rather than something meant for a server. Head over to the download page for all the options.
Don't link to GitHub directly. The library is not supposed to work straight from the source, it requires building. If none of the pre-packaged options work for you refer to the building documentation.
The CDN-hosted package doesn't have all the languages. Otherwise it'd be too big. If you don't see the language you need in the "Common" section, it can be added manually:
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/go.min.js"></script>
On Almond. You need to use the optimizer to give the module a name. For example:
r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js
License
Highlight.js is released under the BSD License. See LICENSE file for details.
Links
The official site for the library is at https://highlightjs.org/.
Further in-depth documentation for the API and other topics is at http://highlightjs.readthedocs.io/.
Authors and contributors are listed in the AUTHORS.en.txt file.