<commit_before><!DOCTYPE html>
<head>
  <title>Highlight</title>
  <meta charset="utf-8">

  <link rel="stylesheet" title="Default" href="styles/default.css">
  <link rel="alternate stylesheet" title="Dark" href="styles/dark.css">
  <link rel="alternate stylesheet" title="FAR" href="styles/far.css">
  <link rel="alternate stylesheet" title="IDEA" href="styles/idea.css">
  <link rel="alternate stylesheet" title="Sunburst" href="styles/sunburst.css">
  <link rel="alternate stylesheet" title="Zenburn" href="styles/zenburn.css">
  <link rel="alternate stylesheet" title="Visual Studio" href="styles/vs.css">
  <link rel="alternate stylesheet" title="Ascetic" href="styles/ascetic.css">
  <link rel="alternate stylesheet" title="Magula" href="styles/magula.css">
  <link rel="alternate stylesheet" title="GitHub" href="styles/github.css">
  <link rel="alternate stylesheet" title="Brown Paper" href="styles/brown_paper.css">
  <link rel="alternate stylesheet" title="School Book" href="styles/school_book.css">
  <link rel="alternate stylesheet" title="IR_Black" href="styles/ir_black.css">
  <style>
    h2 {
      font: bold 100% Arial, sans-serif;
      margin-top: 2em;
      margin-bottom: 0.5em;
    }
    table {
      width: 100%;
    }
    th {
      width: 10em; font-weight: normal;
    }
    td, th {
      vertical-align: top;
      text-align: left;
    }
    pre {
      margin-top: 0;
    }
    ul#switch {
      padding: 0;
      margin: 0 0 0 -0.5em;
    }
    ul#switch li {
      border-bottom: 1px dashed blue;
      display: inline;
      padding: 0;
      margin: 0.5em;
      cursor: pointer;
    }
    ul#switch li.current {
      border-bottom: none;
      cursor: default;
    }
  </style>

  <!--
  Don't include languages as individual files in production environment.
  Instead use <script src="highlight.pack.js"></script> with highlight.pack.js
  containing all the languages you've chosen when downloading the library
  -->
  <script src="highlight.js"></script>
  <script src="languages/cs.js"></script>
  <script src="languages/python.js"></script>
  <script src="languages/mel.js"></script>
  <script src="languages/perl.js"></script>
  <script src="languages/axapta.js"></script>
  <script src="languages/cpp.js"></script>
  <script src="languages/sql.js"></script>
  <script src="languages/smalltalk.js"></script>
  <script src="languages/profile.js"></script>
  <script src="languages/bash.js"></script>
  <script src="languages/html-xml.js"></script>
  <script src="languages/renderman.js"></script>
  <script src="languages/1c.js"></script>
  <script src="languages/delphi.js"></script>
  <script src="languages/dos.js"></script>
  <script src="languages/django.js"></script>
  <script src="languages/vbscript.js"></script>
  <script src="languages/ini.js"></script>
  <script src="languages/apache.js"></script>
  <script src="languages/nginx.js"></script>
  <script src="languages/ruby.js"></script>
  <script src="languages/css.js"></script>
  <script src="languages/lisp.js"></script>
  <script src="languages/java.js"></script>
  <script src="languages/javascript.js"></script>
  <script src="languages/php.js"></script>
  <script src="languages/diff.js"></script>
  <script src="languages/avrasm.js"></script>
  <script src="languages/parser3.js"></script>
  <script src="languages/scala.js"></script>
  <script src="languages/tex.js"></script>
  <script>
  hljs.tabReplace = '    ';
  hljs.initHighlightingOnLoad();
  </script>

  <script>
  // A stylesheet switcher for the test page. Not part of the highlight.js itself
  // (c) <NAME> <<EMAIL>>
  (function(container_id) {
      if (window.addEventListener) {
          var attach = function(el, ev, handler) {
              el.addEventListener(ev, handler, false);
          }
      } else if (window.attachEvent) {
          var attach = function(el, ev, handler) {
              el.attachEvent('on' + ev, handler);
          }
      } else {
          var attach = function(el, ev, handler) {
              ev['on' + ev] = handler;
          }
      }


      attach(window, 'load', function() {
          var current = null;

          var info = {};
          var links = document.getElementsByTagName('link');
          var ul = document.createElement('ul')

          for (var i = 0; (link = links[i]); i++) {
              if (link.getAttribute('rel').indexOf('style') != -1
                  && link.title) {

                  var title = link.title;

                  info[title] = {
                  'link': link,
                  'li': document.createElement('li')
                  }

                  ul.appendChild(info[title].li)
                  info[title].li.title = title;

                  info[title].link.disabled = true;

                  info[title].li.appendChild(document.createTextNode(title));
                  attach(info[title].li, 'click', (function (el) {
                      return function() {
                          current.li.className = '';
                          current.link.disabled = true;
                          current = el;
                          current.li.className = 'current';
                          current.link.disabled = false;
                      }})(info[title]));
              }
          }

          current = info['Default']
          current.li.className = 'current';
          current.link.disabled = false;

          ul.id = 'switch';
          container = document.getElementById(container_id);
          container.appendChild(ul);
      });

  })('styleswitcher');
  </script>
<body>

<p>This page is a demo/test showing all languages supported by <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js</a>.
Most of the code doesn't work :-).
<p>You can see this page in several different styles bundled with the library or
write your own (and contribute it back!)

<div id="styleswitcher"></div>

<h2>Automatically detected languages</h2>

<table>
  <tr>
    <th>Python
    <td>
<pre>
<code>@requires_authorization
def somefunc(param1, param2):
  r'''A docstring'''
  if param1 > param2: # interesting
    print 'Gre\'ater'
    print ''
  return (param2 - param1 + 1) or None

class SomeClass:<br>    pass
</code></pre>

  <tr>
    <th>Python's profiler output
    <td>
<pre><code>       261917242 function calls in 686.251 CPU seconds

       ncalls  tottime  filename:lineno(function)
       152824  513.894  {method 'sort' of 'list' objects}
    129590630   83.894  rrule.py:842(__cmp__)
    129590630   82.439  {cmp}
       153900    1.296  rrule.py:399(_iter)
304393/151570    0.963  rrule.py:102(_iter_cached)
</code></pre>

  <tr>
    <th>Ruby
    <td>
<pre><code>class A &lt; B; def self.create(object = User) object end end
class Zebra; def inspect; "X#{2 + self.object_id}" end end
  
module ABC::DEF
  # @param test
  # @return [String] nothing
  def foo(test)
    Thread.new do |blockvar|
      ABC::DEF.reverse(:a_symbol + :'a symbol' + 'test' + test)
    end.join
  end
  
  def [](index) self[index] end
  def ==(other) other == self end
end

anIdentifier = an_identifier
Constant = 1
</code></pre>

  <tr>
    <th>Perl
    <td>
<pre><code># loads object
sub load
{
  my $flds = $c-&gt;db_load($id,@_) || do {<commit_msg>Update Ruby example in test.html<commit_after><!DOCTYPE html>
<head>
  <title>Highlight</title>
  <meta charset="utf-8">

  <link rel="stylesheet" title="Default" href="styles/default.css">
  <link rel="alternate stylesheet" title="Dark" href="styles/dark.css">
  <link rel="alternate stylesheet" title="FAR" href="styles/far.css">
  <link rel="alternate stylesheet" title="IDEA" href="styles/idea.css">
  <link rel="alternate stylesheet" title="Sunburst" href="styles/sunburst.css">
  <link rel="alternate stylesheet" title="Zenburn" href="styles/zenburn.css">
  <link rel="alternate stylesheet" title="Visual Studio" href="styles/vs.css">
  <link rel="alternate stylesheet" title="Ascetic" href="styles/ascetic.css">
  <link rel="alternate stylesheet" title="Magula" href="styles/magula.css">
  <link rel="alternate stylesheet" title="GitHub" href="styles/github.css">
  <link rel="alternate stylesheet" title="Brown Paper" href="styles/brown_paper.css">
  <link rel="alternate stylesheet" title="School Book" href="styles/school_book.css">
  <link rel="alternate stylesheet" title="IR_Black" href="styles/ir_black.css">
  <style>
    h2 {
      font: bold 100% Arial, sans-serif;
      margin-top: 2em;
      margin-bottom: 0.5em;
    }
    table {
      width: 100%;
    }
    th {
      width: 10em; font-weight: normal;
    }
    td, th {
      vertical-align: top;
      text-align: left;
    }
    pre {
      margin-top: 0;
    }
    ul#switch {
      padding: 0;
      margin: 0 0 0 -0.5em;
    }
    ul#switch li {
      border-bottom: 1px dashed blue;
      display: inline;
      padding: 0;
      margin: 0.5em;
      cursor: pointer;
    }
    ul#switch li.current {
      border-bottom: none;
      cursor: default;
    }
  </style>

  <!--
  Don't include languages as individual files in production environment.
  Instead use <script src="highlight.pack.js"></script> with highlight.pack.js
  containing all the languages you've chosen when downloading the library
  -->
  <script src="highlight.js"></script>
  <script src="languages/cs.js"></script>
  <script src="languages/python.js"></script>
  <script src="languages/mel.js"></script>
  <script src="languages/perl.js"></script>
  <script src="languages/axapta.js"></script>
  <script src="languages/cpp.js"></script>
  <script src="languages/sql.js"></script>
  <script src="languages/smalltalk.js"></script>
  <script src="languages/profile.js"></script>
  <script src="languages/bash.js"></script>
  <script src="languages/html-xml.js"></script>
  <script src="languages/renderman.js"></script>
  <script src="languages/1c.js"></script>
  <script src="languages/delphi.js"></script>
  <script src="languages/dos.js"></script>
  <script src="languages/django.js"></script>
  <script src="languages/vbscript.js"></script>
  <script src="languages/ini.js"></script>
  <script src="languages/apache.js"></script>
  <script src="languages/nginx.js"></script>
  <script src="languages/ruby.js"></script>
  <script src="languages/css.js"></script>
  <script src="languages/lisp.js"></script>
  <script src="languages/java.js"></script>
  <script src="languages/javascript.js"></script>
  <script src="languages/php.js"></script>
  <script src="languages/diff.js"></script>
  <script src="languages/avrasm.js"></script>
  <script src="languages/parser3.js"></script>
  <script src="languages/scala.js"></script>
  <script src="languages/tex.js"></script>
  <script>
  hljs.tabReplace = '    ';
  hljs.initHighlightingOnLoad();
  </script>

  <script>
  // A stylesheet switcher for the test page. Not part of the highlight.js itself
  // (c) <NAME> <<EMAIL>>
  (function(container_id) {
      if (window.addEventListener) {
          var attach = function(el, ev, handler) {
              el.addEventListener(ev, handler, false);
          }
      } else if (window.attachEvent) {
          var attach = function(el, ev, handler) {
              el.attachEvent('on' + ev, handler);
          }
      } else {
          var attach = function(el, ev, handler) {
              ev['on' + ev] = handler;
          }
      }


      attach(window, 'load', function() {
          var current = null;

          var info = {};
          var links = document.getElementsByTagName('link');
          var ul = document.createElement('ul')

          for (var i = 0; (link = links[i]); i++) {
              if (link.getAttribute('rel').indexOf('style') != -1
                  && link.title) {

                  var title = link.title;

                  info[title] = {
                  'link': link,
                  'li': document.createElement('li')
                  }

                  ul.appendChild(info[title].li)
                  info[title].li.title = title;

                  info[title].link.disabled = true;

                  info[title].li.appendChild(document.createTextNode(title));
                  attach(info[title].li, 'click', (function (el) {
                      return function() {
                          current.li.className = '';
                          current.link.disabled = true;
                          current = el;
                          current.li.className = 'current';
                          current.link.disabled = false;
                      }})(info[title]));
              }
          }

          current = info['Default']
          current.li.className = 'current';
          current.link.disabled = false;

          ul.id = 'switch';
          container = document.getElementById(container_id);
          container.appendChild(ul);
      });

  })('styleswitcher');
  </script>
<body>

<p>This page is a demo/test showing all languages supported by <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js</a>.
Most of the code doesn't work :-).
<p>You can see this page in several different styles bundled with the library or
write your own (and contribute it back!)

<div id="styleswitcher"></div>

<h2>Automatically detected languages</h2>

<table>
  <tr>
    <th>Python
    <td>
<pre>
<code>@requires_authorization
def somefunc(param1, param2):
  r'''A docstring'''
  if param1 > param2: # interesting
    print 'Gre\'ater'
    print ''
  return (param2 - param1 + 1) or None

class SomeClass:<br>    pass
</code></pre>

  <tr>
    <th>Python's profiler output
    <td>
<pre><code>       261917242 function calls in 686.251 CPU seconds

       ncalls  tottime  filename:lineno(function)
       152824  513.894  {method 'sort' of 'list' objects}
    129590630   83.894  rrule.py:842(__cmp__)
    129590630   82.439  {cmp}
       153900    1.296  rrule.py:399(_iter)
304393/151570    0.963  rrule.py:102(_iter_cached)
</code></pre>

  <tr>
    <th>Ruby
    <td>
<pre><code>class A &lt; B; def self.create(object = User) object end end
class Zebra; def inspect; "X#{2 + self.object_id}" end end
  
module ABC::DEF
  include Comparable

  # @param test
  # @return [String] nothing
  def foo(test)
    Thread.new do |blockvar|
      ABC::DEF.reverse(:a_symbol, :'a symbol' + 'test' + test)
    end.join
  end
  
  def [](index) self[index] end
  def ==(other) other == self end
end

anIdentifier = an_identifier
Constant = 1
</code></pre>

  <tr>
    <th>Perl
    <td>
<pre><code># loads object
sub load
{
  my $flds = $c-&gt;db_load($id,@_) || do {
{'fraction_non_alphanumeric': 0.15565193446234338, 'fraction_numerical': 0.017761255679471292, 'mean_word_length': 2.6814495691839837, 'pattern_counts': {'":': 0, '<': 265, '<?xml version=': 0, '>': 267, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5235413', 'n_tokens_mistral': 4875, 'n_tokens_neox': 4585, 'n_words': 1036}