1<!DOCTYPE html>
2<head>
3  <title>Highlight</title>
4  <meta charset="utf-8">
5
6  <link rel="stylesheet" title="Default" href="styles/default.css">
7  <link rel="alternate stylesheet" title="Dark" href="styles/dark.css">
8  <link rel="alternate stylesheet" title="FAR" href="styles/far.css">
9  <link rel="alternate stylesheet" title="IDEA" href="styles/idea.css">
10  <link rel="alternate stylesheet" title="Sunburst" href="styles/sunburst.css">
11  <link rel="alternate stylesheet" title="Zenburn" href="styles/zenburn.css">
12  <link rel="alternate stylesheet" title="Visual Studio" href="styles/vs.css">
13  <link rel="alternate stylesheet" title="Ascetic" href="styles/ascetic.css">
14  <link rel="alternate stylesheet" title="Magula" href="styles/magula.css">
15  <link rel="alternate stylesheet" title="GitHub" href="styles/github.css">
16  <link rel="alternate stylesheet" title="Brown Paper" href="styles/brown_paper.css">
17  <link rel="alternate stylesheet" title="School Book" href="styles/school_book.css">
18  <link rel="alternate stylesheet" title="IR_Black" href="styles/ir_black.css">
19  <style>
20    h2 {
21      font: bold 100% Arial, sans-serif;
22      margin-top: 2em;
23      margin-bottom: 0.5em;
24    }
25    table {
26      width: 100%;
27    }
28    th {
29      width: 10em; font-weight: normal;
30    }
31    td, th {
32      vertical-align: top;
33      text-align: left;
34    }
35    pre {
36      margin-top: 0;
37    }
38    ul#switch {
39      padding: 0;
40      margin: 0 0 0 -0.5em;
41    }
42    ul#switch li {
43      border-bottom: 1px dashed blue;
44      display: inline;
45      padding: 0;
46      margin: 0.5em;
47      cursor: pointer;
48    }
49    ul#switch li.current {
50      border-bottom: none;
51      cursor: default;
52    }
53  </style>
54
55  <!--
56  Don't include languages as individual files in production environment.
57  Instead use <script src="highlight.pack.js"></script> with highlight.pack.js
58  containing all the languages you've chosen when downloading the library
59  -->
60  <script src="highlight.js"></script>
61  <script src="languages/cs.js"></script>
62  <script src="languages/python.js"></script>
63  <script src="languages/mel.js"></script>
64  <script src="languages/perl.js"></script>
65  <script src="languages/axapta.js"></script>
66  <script src="languages/cpp.js"></script>
67  <script src="languages/sql.js"></script>
68  <script src="languages/smalltalk.js"></script>
69  <script src="languages/profile.js"></script>
70  <script src="languages/bash.js"></script>
71  <script src="languages/html-xml.js"></script>
72  <script src="languages/renderman.js"></script>
73  <script src="languages/1c.js"></script>
74  <script src="languages/delphi.js"></script>
75  <script src="languages/dos.js"></script>
76  <script src="languages/django.js"></script>
77  <script src="languages/vbscript.js"></script>
78  <script src="languages/ini.js"></script>
79  <script src="languages/apache.js"></script>
80  <script src="languages/ruby.js"></script>
81  <script src="languages/css.js"></script>
82  <script src="languages/lisp.js"></script>
83  <script src="languages/java.js"></script>
84  <script src="languages/javascript.js"></script>
85  <script src="languages/php.js"></script>
86  <script src="languages/diff.js"></script>
87  <script src="languages/avrasm.js"></script>
88  <script src="languages/parser3.js"></script>
89  <script>
90  hljs.tabReplace = '    ';
91  hljs.initHighlightingOnLoad();
92  </script>
93
94  <script>
95  // A stylesheet switcher for the test page. Not part of the highlight.js itself
96  // (c) Vladimir Epifanov <voldmar@voldmar.ru>
97  (function(container_id) {
98      if (window.addEventListener) {
99          var attach = function(el, ev, handler) {
100              el.addEventListener(ev, handler, false);
101          }
102      } else if (window.attachEvent) {
103          var attach = function(el, ev, handler) {
104              el.attachEvent('on' + ev, handler);
105          }
106      } else {
107          var attach = function(el, ev, handler) {
108              ev['on' + ev] = handler;
109          }
110      }
111
112
113      attach(window, 'load', function() {
114          var current = null;
115
116          var info = {};
117          var links = document.getElementsByTagName('link');
118          var ul = document.createElement('ul')
119
120          for (var i = 0; (link = links[i]); i++) {
121              if (link.getAttribute('rel').indexOf('style') != -1
122                  && link.title) {
123
124                  var title = link.title;
125
126                  info[title] = {
127                  'link': link,
128                  'li': document.createElement('li')
129                  }
130
131                  ul.appendChild(info[title].li)
132                  info[title].li.title = title;
133t                  info[title].link.disabled = true;
134
135                  info[title].li.appendChild(document.createTextNode(title));
136                  attach(info[title].li, 'click', (function (el) {
137                      return function() {
138                          current.li.className = '';
139                          current.link.disabled = true;
140                          current = el;
141                          current.li.className = 'current';
142                          current.link.disabled = false;
143                      }})(info[title]));
144              }
145          }
146
147          current = info['Default']
148          current.li.className = 'current';
149          current.link.disabled = false;
150
151          ul.id = 'switch';
152          container = document.getElementById(container_id);
153          container.appendChild(ul);
154      });
155
156  })('styleswitcher');
157  </script>
158<body>
159
160<p>This page is a demo/test showing all languages supported by <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js</a>.
161Most of the code doesn't work :-).
162<p>You can see this page in several different styles bundled with the library or
163write your own (and contribute it back!)
164
165<div id="styleswitcher"></div>
166
167<h2>Automatically detected languages</h2>
168
169<table>
170  <tr>
171    <th>Python
172    <td>
173<pre>
174<code>@requires_authorization
175def somefunc(param1, param2):
176  r'''A docstring'''
177  if param1 > param2: # interesting
178    print 'Gre\'ater'
179    print ''
180  return (param2 - param1 + 1) or None
181
182class SomeClass:<br>    pass
183</code></pre>
184
185  <tr>
186    <th>Python's profiler output
187    <td>
188<pre><code>       261917242 function calls in 686.251 CPU seconds
189
190       ncalls  tottime  filename:lineno(function)
191       152824  513.894  {method 'sort' of 'list' objects}
192    129590630   83.894  rrule.py:842(__cmp__)
193    129590630   82.439  {cmp}
194       153900    1.296  rrule.py:399(_iter)
195304393/151570    0.963  rrule.py:102(_iter_cached)
196</code></pre>
197
198  <tr>
199    <th>Ruby
200    <td>
201<pre><code>class CategoriesController &lt; App::ApplicationController
202  layout "core"
203
204  before_filter :login_required
205  before_filter :xhr_required, :only =&gt; [:create, :update]
206  before_filter :admin_privileges_required, :except =&gt; [:show]
207
208=begin
209  This method creates a category. Very difficult to understand, huh?
210=end
211
212  def create  # create!
213    @category = Category.create(params[:category])
214    flash[:notice] = "Category #{@category + "..."} was successfully created"
215  end
216end
217</code></pre>
218
219  <tr>
220    <th>Perl
221    <td>
222<pre><code># loads object
223sub load
224{
225  my $flds = $c-&gt;db_load($id,@_) || do {
226    Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef
227  };
228  my $o = $c-&gt;_perl_new();
229  $id12 = $id;
230  $o-&gt;{'ID'} = $id12 + 123;
231  $o-&gt;{'PAPA'} = $flds-&gt;{'PAPA'};
232  #$o-&gt;{'SHCUT'} = $flds-&gt;{'SHCUT'};
233  my $p = $o-&gt;props;
234  my $vt;
235  $string =~ m/^sought_text$/;
236  for my $key (keys %$p)
237  {
238    if(${$vt.'::property'}) {
239      $o-&gt;{$key . '_real'} = $flds-&gt;{$key};
240      tie $o-&gt;{$key}, 'CMSBuilder::Property', $o, $key;
241    } else {
242      $o-&gt;{$key} = $flds-&gt;{$key};
243    }
244  }
245  $o-&gt;save if delete $o-&gt;{'_save_after_load'};
246  return $o;
247}
248</code></pre>
249
250  <tr>
251    <th>PHP
252    <td>
253<pre><code>require_once 'Zend.php';
254require_once 'Zend/Uri/Exception.php';
255require_once 'Zend/Uri/Http.php';
256require_once 'Zend/Uri/Mailto.php';
257
258abstract class Zend_Uri
259{
260
261  /**
262   * Return a string representation of this URI.
263   *
264   * @see     getUri()
265   * @return  string
266   */
267  public function __toString()
268  {
269      return $this-&gt;getUri();
270  }
271
272  static public function factory($uri = 'http')
273  {
274      $uri = explode(':', $uri, 2);
275      $scheme = strtolower($uri[0]);
276      $schemeSpecific = isset($uri[1]) ? $uri[1] : '';
277
278      // Security check: $scheme is used to load a class file,
279      // so only alphanumerics are allowed.
280      if (!ctype_alnum($scheme)) {
281          throw new Zend_Uri_Exception('Illegal scheme');
282      }
283  }
284}
285</code></pre>
286
287  <tr>
288    <th>XML
289    <td>
290<pre><code>&lt;?xml version="1.0"?&gt;
291&lt;response value="ok" xml:lang="en"&gt;
292  &lt;text&gt;Ok&lt;/text&gt;
293  &lt;comment/&gt;
294  &lt;ns:description&gt;&lt;![CDATA[
295  CDATA is &lt;not&gt; magical.
296  ]]&gt;&lt;/ns:description&gt;
297&lt;/response&gt;
298</code></pre>
299
300  <tr>
301    <th>HTML (with inline css and javascript)
302    <td>
303<pre><code>&lt;head&gt;
304  &lt;title&gt;Title&lt;/title&gt;
305
306  &lt;style&gt;
307    body {
308      width: 500px;
309    }
310  &lt;/style&gt;
311
312  &lt;script&gt;
313    function someFunction() {
314      return true;
315    }
316  &lt;/script&gt;
317
318&lt;body&gt;
319  &lt;p class="something" id='12'&gt;Something&lt;/p&gt;
320  &lt;p class=something&gt;Something&lt;/p&gt;
321  &lt;!-- comment --&gt;
322  &lt;p class&gt;Something&lt;/p&gt;
323  &lt;p class="something" title="p"&gt;Something&lt;/p&gt;
324&lt;/body&gt;
325</code></pre>
326
327  <tr>
328    <th>Django templates
329    <td>
330<pre><code>{% if articles|length %}
331{% for article in articles %}
332
333{# Striped table #}
334&lt;tr class="{% cycle odd,even %}"&gt;
335  &lt;td&gt;{{ article|default:"Hi... "|escape }}&lt;/td&gt;
336  &lt;td&gt;{{ article.date|date:"d.m.Y" }}&lt;/td&gt;
337&lt;/tr&gt;
338
339{% endfor %}
340{% endif %}
341
342{% comment %}
343Comments may be long and
344multiline.
345{% endcomment %}
346</code></pre>
347
348  <tr>
349    <th>CSS
350    <td>
351<pre><code>body,
352html {
353  font: Tahoma, Arial, san-serif;
354  background: url('hatch.png');
355}
356
357@import url('print.css');
358
359@media screen and (-webkit-min-device-pixel-ratio: 0) {
360  @page :left {
361    body:first-of-type pre::after {
362      content: 'highlight: ' attr(class);
363    }
364}
365
366#content {
367  width: 100%; /* wide enough */
368  height: 100%
369}
370
371p[lang=ru] {
372  color: #F0F0F0; background: white;
373}
374</code></pre>
375
376  <tr>
377    <th>Javascript
378    <td>
379<pre><code>function $initHighlight(block) {
380  if (block.className.search(/\bno\-highlight\b/) != -1)
381    return false;
382  try {
383    blockText(block);
384  } catch (e) {
385    if (e == 'Complex markup')
386      return;
387  }//try
388  var classes = block.className.split(/\s+/);
389  for (var i = 0 / 2; i &lt; classes.length; i++) { // "0 / 2" should not be parsed as regexp start
390    if (LANGUAGES[classes[i]]) {
391      highlightLanguage(block, classes[i]);
392      return;
393    }//if
394  }//for
395  highlightAuto(block);
396}//initHighlight</code></pre>
397
398  <tr>
399    <th>VBScript
400    <td>
401<pre><code>' creating configuration storage and initializing with default values
402Set cfg = CreateObject("Scripting.Dictionary")
403
404' reading ini file
405for i = 0 to ubound(ini_strings)
406    s = trim(ini_strings(i))
407
408    ' skipping empty strings and comments
409    if mid(s, 1, 1) &lt;&gt; "#" and len(s) > 0 then
410      ' obtaining key and value
411      parts = split(s, "=", -1, 1)
412
413      if ubound(parts)+1 = 2 then
414        parts(0) = trim(parts(0))
415        parts(1) = trim(parts(1))
416
417        ' reading configuration and filenames
418        select case lcase(parts(0))
419          case "uncompressed""_postfix" cfg.item("uncompressed""_postfix") = parts(1)
420          case "f"
421                    options = split(parts(1), "|", -1, 1)
422                    if ubound(options)+1 = 2 then
423                      ' 0: filename,  1: options
424                      ff.add trim(options(0)), trim(options(1))
425                    end if
426        end select
427      end if
428    end if
429next</code></pre>
430
431  <tr>
432    <th>Delphi
433    <td>
434<pre><code>TList=Class(TObject)
435Private
436  Some: String;
437Public
438  Procedure Inside;
439End;{TList}
440
441Procedure CopyFile(InFileName,var OutFileName:String);
442Const
443  BufSize=4096; (* Huh? *)
444Var
445  InFile,OutFile:TStream;
446  Buffer:Array[1..BufSize] Of Byte;
447  ReadBufSize:Integer;
448Begin
449  InFile:=Nil;
450  OutFile:=Nil;
451  Try
452    InFile:=TFileStream.Create(InFileName,fmOpenRead);
453    OutFile:=TFileStream.Create(OutFileName,fmCreate);
454    Repeat
455      ReadBufSize:=InFile.Read(Buffer,BufSize);
456      OutFile.Write(Buffer,ReadBufSize);
457    Until ReadBufSize&lt;&gt;BufSize;
458    Log('File '''+InFileName+''' copied'#13#10);
459  Finally
460    InFile.Free;
461    OutFile.Free;
462  End;{Try}
463End;{CopyFile}
464</code></pre>
465
466  <tr>
467    <th>Java
468    <td>
469<pre><code>package l2f.gameserver.model;
470
471import java.util.ArrayList;
472
473/**
474 * Mother class of all character objects of the world (PC, NPC...)&lt;BR&gt;&lt;BR&gt;
475 *
476 */
477public abstract class L2Character extends L2Object
478{
479  protected static final Logger _log = Logger.getLogger(L2Character.class.getName());
480
481  public static final Short ABNORMAL_EFFECT_BLEEDING = 0x0001; // not sure
482  public static final Short ABNORMAL_EFFECT_POISON = 0x0002;
483
484  public void detachAI() {
485    _ai = null;
486    //jbf = null;
487    if (1 > 5) {
488      return;
489    }
490  }
491
492  public void moveTo(int x, int y, int z) {
493    moveTo(x, y, z, 0);
494  }
495
496  /** Task of AI notification */
497  @SuppressWarnings( { "nls", "unqualified-field-access", "boxing" })
498  public class NotifyAITask implements Runnable {
499    private final CtrlEvent _evt;
500
501    public void run() {
502      try {
503        getAI().notifyEvent(_evt, null, null);
504      } catch (Throwable t) {
505        _log.warning("Exception " + t);
506        t.printStackTrace();
507      }
508    }
509  }
510
511}
512</code></pre>
513
514  <tr>
515    <th>C++
516    <td>
517<pre><code>#include &lt;iostream&gt;
518
519int main(int argc, char *argv[]) {
520
521  /* An annoying "Hello World" example */
522  for (unsigned i = 0; i &lt; 0xFFFF; i++)
523    cout &lt;&lt; "Hello, World!" &lt;&lt; endl;
524
525  char c = '\n'; // just a test
526  map &lt;string, vector&lt;string&gt; &gt; m;
527  m["key"] = "\\\\"; // yeah, I know it's an error
528}
529</code></pre>
530
531  <tr>
532    <th>C#
533    <td>
534<pre><code>using System;
535
536public class Program
537{
538    /// &lt;summary&gt;The entry point to the program.&lt;/summary&gt;
539    /// &lt;remarks&gt;
540    /// Using the Visual Studio style, the tags in this comment
541    /// should be grey, but this text should be green.
542    /// This comment should be green on the inside:
543    /// &lt;!-- I'm green! --&gt;
544    /// &lt;/remarks&gt;
545    public static int Main(string[] args)
546    {
547        Console.WriteLine("Hello, World!");
548        string s = @"This
549""string""
550spans
551multiple
552lines!";
553        return 0;
554    }
555}
556</code></pre>
557
558  <tr>
559    <th>RenderMan RSL
560    <td>
561<pre><code>#define TEST_DEFINE 3.14
562/*	plastic surface shader
563 *
564 * 	Pixie is:
565 * 	(c) Copyright 1999-2003 Okan Arikan. All rights reserved.
566 */
567
568surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1;
569                 color specularcolor = 1;) {
570  normal Nf = faceforward (normalize(N),I);
571  Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks *
572       specular(Nf,-normalize(I),roughness);
573  Oi = Os;
574  Ci *= Oi;
575}
576</code></pre>
577
578  <tr>
579    <th>RenderMan RIB
580    <td>
581<pre><code>FrameBegin 0
582Display "Scene" "framebuffer" "rgb"
583Option "searchpath" "shader" "+&:/home/kew"
584Option "trace" "int maxdepth" [4]
585Attribute "visibility" "trace" [1]
586Attribute "irradiance" "maxerror" [0.1]
587Attribute "visibility" "transmission" "opaque"
588Format 640 480 1.0
589ShadingRate 2
590PixelFilter "catmull-rom" 1 1
591PixelSamples 4 4
592Projection "perspective" "fov" 49.5502811377
593Scale 1 1 -1
594
595WorldBegin
596
597ReadArchive "Lamp.002_Light/instance.rib"
598Surface "plastic"
599ReadArchive "Cube.004_Mesh/instance.rib"
600# ReadArchive "Sphere.010_Mesh/instance.rib"
601# ReadArchive "Sphere.009_Mesh/instance.rib"
602ReadArchive "Sphere.006_Mesh/instance.rib"
603
604WorldEnd
605FrameEnd
606</code></pre>
607
608  <tr>
609    <th>MEL (Maya Embedded Language)
610    <td>
611<pre><code class="mel">proc string[] getSelectedLights()
612
613{
614  string $selectedLights[];
615
616  string $select[] = `ls -sl -dag -leaf`;
617
618  for ( $shape in $select )
619  {
620    // Determine if this is a light.
621    //
622    string $class[] = getClassification( `nodeType $shape` );
623
624
625    if ( ( `size $class` ) > 0 &amp;&amp; ( "light" == $class[0] ) )
626    {
627      $selectedLights[ `size $selectedLights` ] = $shape;
628    }
629  }
630
631  // Result is an array of all lights included in
632
633  // current selection list.
634  return $selectedLights;
635}
636</code></pre>
637
638  <tr>
639    <th>SQL
640    <td>
641<pre><code>BEGIN;
642CREATE TABLE "cicero_topic" (
643    "id" serial NOT NULL PRIMARY KEY,
644    "forum_id" integer NOT NULL,
645    "subject" varchar(255) NOT NULL,
646    "created" timestamp with time zone NOT NULL
647);
648ALTER TABLE "cicero_topic"
649ADD CONSTRAINT forum_id_refs_id_4be56999
650FOREIGN KEY ("forum_id")
651REFERENCES "cicero_forum" ("id")
652DEFERRABLE INITIALLY DEFERRED;
653
654-- Initials
655insert into "cicero_forum"
656  ("slug", "name", "group", "ordering")
657values
658  ('test', 'Forum for te''sting', 'Test', 0);
659
660-- Test
661select count(*) from cicero_forum;
662
663COMMIT;
664</code></pre>
665
666  <tr>
667    <th>SmallTalk
668    <td>
669<pre><code>Object>>method: num
670    "comment 123"
671    | var1 var2 |
672    (1 to: num) do: [:i | |var| ^i].
673    Klass with: var1.
674    Klass new.
675    arr := #('123' 123.345 #hello Transcript var $@).
676    arr := #().
677    var2 = arr at: 3.
678    ^ self abc
679
680heapExample
681    "HeapTest new heapExample"
682    "Multiline
683    decription"
684    | n rnd array time sorted |
685    n := 5000.
686    "# of elements to sort"
687    rnd := Random new.
688    array := (1 to: n)
689                collect: [:i | rnd next].
690    "First, the heap version"
691    time := Time
692                millisecondsToRun: [sorted := Heap withAll: array.
693    1
694        to: n
695        do: [:i |
696            sorted removeFirst.
697            sorted add: rnd next]].
698    Transcript cr; show: 'Time for Heap: ' , time printString , ' msecs'.
699    "The quicksort version"
700    time := Time
701                millisecondsToRun: [sorted := SortedCollection withAll: array.
702    1
703        to: n
704        do: [:i |
705            sorted removeFirst.
706            sorted add: rnd next]].
707    Transcript cr; show: 'Time for SortedCollection: ' , time printString , ' msecs'
708</code></pre>
709
710  <tr>
711    <th>Lisp
712    <th><pre><code>(defun prompt-for-cd ()
713   (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6))
714   (prompt-read "Artist" &amp;rest)
715   (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
716  (if x (format t "yes") (format t "no" nil) ;and here comment
717  )
718  ;; second line comment
719  '(+ 1 2)
720  (defvar *lines*)                ; list of all lines
721  (position-if-not #'sys::whitespacep line :start beg))
722  (quote (privet 1 2 3))
723  '(hello world)
724  (* 5 7)
725  (1 2 34 5)
726  (:use "aaaa")
727  (let ((x 10) (y 20))
728    (print (+ x y))
729  )</code></pre>
730
731  <tr>
732    <th>Ini file
733    <td>
734<pre><code>;Settings relating to the location and loading of the database
735[Database]
736ProfileDir=.
737ShowProfileMgr=smart
738Profile1_Name[] = "\|/_-=MegaDestoyer=-_\|/"
739DefaultProfile=True
740AutoCreate = no
741
742[AutoExec]
743Use="prompt"
744Glob=autoexec_*.ini
745AskAboutIgnoredPlugins=0
746</code></pre>
747
748  <tr>
749    <th>Apache
750    <td>
751<pre><code># rewrite`s rules for wordpress pretty url
752LoadModule rewrite_module  modules/mod_rewrite.so
753RewriteCond %{REQUEST_FILENAME} !-f
754RewriteCond %{REQUEST_FILENAME} !-d
755RewriteRule . index.php [NC,L]
756
757ExpiresActive On
758ExpiresByType application/x-javascript  "access plus 1 days"
759
760&lt;Location /maps/&gt;
761  RewriteMap map txt:map.txt
762  RewriteMap lower int:tolower
763  RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
764  RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
765  RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
766&lt;/Location&gt;
767
768  <tr>
769    <th>Diff
770    <td>
771<pre><code>Index: languages/ini.js
772===================================================================
773--- languages/ini.js    (revision 199)
774+++ languages/ini.js    (revision 200)
775@@ -1,8 +1,7 @@
776 hljs.LANGUAGES.ini =
777 {
778   case_insensitive: true,
779-  defaultMode:
780-  {
781+  defaultMode: {
782     contains: ['comment', 'title', 'setting'],
783     illegal: '[^\\s]'
784   },
785
786*** /path/to/original timestamp
787--- /path/to/new      timestamp
788***************
789*** 1,3 ****
790--- 1,9 ----
791+ This is an important
792+ notice! It should
793+ therefore be located at
794+ the beginning of this
795+ document!
796
797! compress the size of the
798! changes.
799
800  It is important to spell
801</code></pre>
802
803  <tr>
804    <th>DOS batch files
805    <td>
806<pre><code>cd \
807copy a b
808ping 192.168.0.1
809@rem ping 192.168.0.1
810net stop sharedaccess
811del %tmp% /f /s /q
812del %temp% /f /s /q
813ipconfig /flushdns
814taskkill /F /IM JAVA.EXE /T
815
816cd Photoshop/Adobe Photoshop CS3/AMT/
817if exist application.sif (
818    ren application.sif _application.sif
819) else (
820    ren _application.sif application.sif
821)
822
823taskkill /F /IM proquota.exe /T
824
825sfc /SCANNOW
826
827set path = test
828
829xcopy %1\*.* %2
830</code></pre>
831
832  <tr>
833    <th>Bash
834    <td>
835<pre><code>#!/bin/bash
836
837###### BEGIN CONFIG
838ACCEPTED_HOSTS="/root/.hag_accepted.conf"
839BE_VERBOSE=false
840###### END CONFIG
841
842if [ "$UID" -ne 0 ]
843then
844 echo "Superuser rights is required"
845 exit 2
846fi
847
848genApacheConf(){
849 if [[ "$2" = "www" ]]
850 then
851  full_domain=$1
852 else
853  full_domain=$2.$1
854 fi
855 host_root="${APACHE_HOME_DIR}$1/$2"
856 echo -e "# Host $1/$2 :"
857}
858</code></pre>
859
860  <tr>
861    <th>Axapta
862    <td>
863<pre><code>class ExchRateLoadBatch extends RunBaseBatch {
864  ExchRateLoad rbc;
865  container currencies;
866  boolean actual;
867  boolean overwrite;
868  date beg;
869  date end;
870
871  #define.CurrentVersion(5)
872
873  #localmacro.CurrentList
874    currencies,
875    actual,
876    beg,
877    end
878  #endmacro
879}
880
881public boolean unpack(container packedClass) {
882  container       base;
883  boolean         ret;
884  Integer         version    = runbase::getVersion(packedClass);
885
886  switch (version) {
887    case #CurrentVersion:
888      [version, #CurrentList] = packedClass;
889      return true;
890    default:
891      return false;
892  }
893  return ret;
894}
895</code></pre>
896
897  <tr>
898    <th>1С
899    <td>
900<pre><code>
901#Если Клиент Тогда
902Перем СимвольныйКодКаталога = "ля-ля-ля"; //комментарий
903Функция Сообщить(Знач ТекстСообщения, ТекстСообщения2) Экспорт //комментарий к функции
904  x=ТекстСообщения+ТекстСообщения2+"
905  |строка1
906  |строка2
907  |строка3";
908КонецФункции
909#КонецЕсли
910
911// Процедура ПриНачалеРаботыСистемы
912//
913Процедура ПриНачалеРаботыСистемы()
914  Обработки.Помощник.ПолучитьФорму("Форма").Открыть();
915  d = '21.01.2008'
916КонецПроцедуры
917</code></pre>
918
919  <tr>
920    <th>AVR Assembler
921    <td>
922<pre><code>;* Title:       Block Copy Routines
923;* Version:     1.1
924
925.include "8515def.inc"
926
927    rjmp    RESET   ;reset handle
928
929.def    flashsize=r16       ;size of block to be copied
930
931flash2ram:
932    lpm         ;get constant
933    st  Y+,r0       ;store in SRAM and increment Y-pointer
934    adiw    ZL,1        ;increment Z-pointer
935    dec flashsize
936    brne    flash2ram   ;if not end of table, loop more
937    ret
938
939.def    ramtemp =r1     ;temporary storage register
940.def    ramsize =r16        ;size of block to be copied
941</code></pre>
942
943  <tr>
944    <th>Parser 3
945    <td>
946<pre><code>@CLASS
947base
948
949@USE
950module.p
951
952@BASE
953class
954
955# Comment for code
956@create[aParam1;aParam2][local1;local2]
957  ^connect[mysql://host/database?ClientCharset=windows-1251]
958  ^for[i](1;10){
959    &lt;p class=&quot;paragraph&quot;&gt;^eval($i+10)&lt;/p&gt;
960    ^connect[mysql://host/database]{
961      $tab[^table::sql{select * from `table` where a='1'}]
962      $var_Name[some${value}]
963    }
964  }
965
966  ^rem{
967    Multiline comment with code: $var
968    ^while(true){
969      ^for[i](1;10){
970        ^sleep[]
971      }
972    }
973  }
974  ^taint[^#0A]
975
976@GET_base[]
977## Comment for code
978  # Isn't comment
979  $result[$.hash_item1[one] $.hash_item2[two]]
980</code></pre>
981
982</table>
983
984<h2>Special tests</h2>
985
986<table>
987  <tr>
988    <th>Explicit Python highlighting
989    <td>
990<pre><code class="python">for x in [1, 2, 3]:
991  count(x)
992</code></pre>
993
994  <tr>
995    <th>Language set on &lt;pre&gt;
996    <td>
997<pre class="python"><code>for x in [1, 2, 3]:
998  count(x)
999</code></pre>
1000
1001  <tr>
1002    <th>HTML5-style language class (language-python)
1003    <td>
1004<pre class="python"><code>for x in [1, 2, 3]:
1005  count(x)
1006</code></pre>
1007
1008  <tr>
1009    <th>Replacing TAB with 4 spaces
1010    <td>
1011<pre><code class="python">for x in [1, 2, 3]:
1012	count(x)
1013</code></pre>
1014
1015  <tr>
1016    <th>Disabled highlighting
1017    <td>
1018<pre><code class="no-highlight">&lt;div id="contents"&gt;
1019  &lt;p&gt;Hello, World!
1020&lt;/div&gt;
1021</code></pre>
1022
1023  <tr>
1024    <th>Custom markup
1025    <td>
1026<pre><code>&lt;<a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</a> id="contents"&gt;
1027  <del>&lt;p&gt;Hello, World!</del>
1028&lt;/div&gt;
1029</code></pre>
1030
1031</table>
1032