gitlab-rouge 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +23 -0
- data/LICENSE +186 -0
- data/bin/rougify +16 -0
- data/gitlab-rouge.gemspec +17 -0
- data/lib/rouge.rb +57 -0
- data/lib/rouge/cli.rb +363 -0
- data/lib/rouge/demos/apache +21 -0
- data/lib/rouge/demos/applescript +2 -0
- data/lib/rouge/demos/c +8 -0
- data/lib/rouge/demos/clojure +5 -0
- data/lib/rouge/demos/coffeescript +5 -0
- data/lib/rouge/demos/common_lisp +1 -0
- data/lib/rouge/demos/conf +4 -0
- data/lib/rouge/demos/cpp +8 -0
- data/lib/rouge/demos/csharp +5 -0
- data/lib/rouge/demos/css +4 -0
- data/lib/rouge/demos/dart +6 -0
- data/lib/rouge/demos/diff +7 -0
- data/lib/rouge/demos/elixir +1 -0
- data/lib/rouge/demos/erb +1 -0
- data/lib/rouge/demos/erlang +7 -0
- data/lib/rouge/demos/factor +5 -0
- data/lib/rouge/demos/gherkin +17 -0
- data/lib/rouge/demos/glsl +14 -0
- data/lib/rouge/demos/go +7 -0
- data/lib/rouge/demos/groovy +9 -0
- data/lib/rouge/demos/haml +5 -0
- data/lib/rouge/demos/handlebars +7 -0
- data/lib/rouge/demos/haskell +6 -0
- data/lib/rouge/demos/html +8 -0
- data/lib/rouge/demos/http +14 -0
- data/lib/rouge/demos/ini +4 -0
- data/lib/rouge/demos/io +11 -0
- data/lib/rouge/demos/java +5 -0
- data/lib/rouge/demos/javascript +1 -0
- data/lib/rouge/demos/json +1 -0
- data/lib/rouge/demos/json-doc +1 -0
- data/lib/rouge/demos/liquid +11 -0
- data/lib/rouge/demos/literate_coffeescript +3 -0
- data/lib/rouge/demos/literate_haskell +7 -0
- data/lib/rouge/demos/llvm +20 -0
- data/lib/rouge/demos/lua +12 -0
- data/lib/rouge/demos/make +6 -0
- data/lib/rouge/demos/markdown +4 -0
- data/lib/rouge/demos/matlab +6 -0
- data/lib/rouge/demos/moonscript +16 -0
- data/lib/rouge/demos/nginx +5 -0
- data/lib/rouge/demos/nim +27 -0
- data/lib/rouge/demos/objective_c +14 -0
- data/lib/rouge/demos/ocaml +12 -0
- data/lib/rouge/demos/perl +5 -0
- data/lib/rouge/demos/php +3 -0
- data/lib/rouge/demos/plaintext +1 -0
- data/lib/rouge/demos/powershell +49 -0
- data/lib/rouge/demos/prolog +9 -0
- data/lib/rouge/demos/properties +7 -0
- data/lib/rouge/demos/puppet +6 -0
- data/lib/rouge/demos/python +6 -0
- data/lib/rouge/demos/qml +9 -0
- data/lib/rouge/demos/r +8 -0
- data/lib/rouge/demos/racket +24 -0
- data/lib/rouge/demos/ruby +9 -0
- data/lib/rouge/demos/rust +12 -0
- data/lib/rouge/demos/sass +3 -0
- data/lib/rouge/demos/scala +3 -0
- data/lib/rouge/demos/scheme +4 -0
- data/lib/rouge/demos/scss +5 -0
- data/lib/rouge/demos/sed +4 -0
- data/lib/rouge/demos/shell +2 -0
- data/lib/rouge/demos/slim +17 -0
- data/lib/rouge/demos/smalltalk +6 -0
- data/lib/rouge/demos/sml +4 -0
- data/lib/rouge/demos/sql +1 -0
- data/lib/rouge/demos/swift +5 -0
- data/lib/rouge/demos/tcl +1 -0
- data/lib/rouge/demos/tex +1 -0
- data/lib/rouge/demos/toml +9 -0
- data/lib/rouge/demos/tulip +14 -0
- data/lib/rouge/demos/vb +4 -0
- data/lib/rouge/demos/viml +5 -0
- data/lib/rouge/demos/xml +2 -0
- data/lib/rouge/demos/yaml +4 -0
- data/lib/rouge/formatter.rb +50 -0
- data/lib/rouge/formatters/html.rb +117 -0
- data/lib/rouge/formatters/null.rb +19 -0
- data/lib/rouge/formatters/terminal256.rb +176 -0
- data/lib/rouge/lexer.rb +443 -0
- data/lib/rouge/lexers/apache.rb +68 -0
- data/lib/rouge/lexers/apache/keywords.yml +453 -0
- data/lib/rouge/lexers/apple_script.rb +367 -0
- data/lib/rouge/lexers/c.rb +212 -0
- data/lib/rouge/lexers/clojure.rb +112 -0
- data/lib/rouge/lexers/coffeescript.rb +174 -0
- data/lib/rouge/lexers/common_lisp.rb +345 -0
- data/lib/rouge/lexers/conf.rb +24 -0
- data/lib/rouge/lexers/cpp.rb +66 -0
- data/lib/rouge/lexers/csharp.rb +88 -0
- data/lib/rouge/lexers/css.rb +271 -0
- data/lib/rouge/lexers/dart.rb +104 -0
- data/lib/rouge/lexers/diff.rb +31 -0
- data/lib/rouge/lexers/elixir.rb +108 -0
- data/lib/rouge/lexers/erb.rb +56 -0
- data/lib/rouge/lexers/erlang.rb +118 -0
- data/lib/rouge/lexers/factor.rb +302 -0
- data/lib/rouge/lexers/gherkin.rb +137 -0
- data/lib/rouge/lexers/gherkin/keywords.rb +14 -0
- data/lib/rouge/lexers/glsl.rb +135 -0
- data/lib/rouge/lexers/go.rb +178 -0
- data/lib/rouge/lexers/groovy.rb +104 -0
- data/lib/rouge/lexers/haml.rb +228 -0
- data/lib/rouge/lexers/handlebars.rb +79 -0
- data/lib/rouge/lexers/haskell.rb +183 -0
- data/lib/rouge/lexers/html.rb +94 -0
- data/lib/rouge/lexers/http.rb +80 -0
- data/lib/rouge/lexers/ini.rb +57 -0
- data/lib/rouge/lexers/io.rb +68 -0
- data/lib/rouge/lexers/java.rb +76 -0
- data/lib/rouge/lexers/javascript.rb +297 -0
- data/lib/rouge/lexers/liquid.rb +287 -0
- data/lib/rouge/lexers/literate_coffeescript.rb +33 -0
- data/lib/rouge/lexers/literate_haskell.rb +36 -0
- data/lib/rouge/lexers/llvm.rb +84 -0
- data/lib/rouge/lexers/lua.rb +122 -0
- data/lib/rouge/lexers/lua/builtins.rb +22 -0
- data/lib/rouge/lexers/make.rb +116 -0
- data/lib/rouge/lexers/markdown.rb +154 -0
- data/lib/rouge/lexers/matlab.rb +74 -0
- data/lib/rouge/lexers/matlab/builtins.rb +11 -0
- data/lib/rouge/lexers/moonscript.rb +110 -0
- data/lib/rouge/lexers/nginx.rb +71 -0
- data/lib/rouge/lexers/nim.rb +152 -0
- data/lib/rouge/lexers/objective_c.rb +197 -0
- data/lib/rouge/lexers/ocaml.rb +111 -0
- data/lib/rouge/lexers/perl.rb +197 -0
- data/lib/rouge/lexers/php.rb +173 -0
- data/lib/rouge/lexers/php/builtins.rb +204 -0
- data/lib/rouge/lexers/plain_text.rb +25 -0
- data/lib/rouge/lexers/powershell.rb +96 -0
- data/lib/rouge/lexers/prolog.rb +64 -0
- data/lib/rouge/lexers/properties.rb +55 -0
- data/lib/rouge/lexers/puppet.rb +128 -0
- data/lib/rouge/lexers/python.rb +228 -0
- data/lib/rouge/lexers/qml.rb +72 -0
- data/lib/rouge/lexers/r.rb +56 -0
- data/lib/rouge/lexers/racket.rb +542 -0
- data/lib/rouge/lexers/ruby.rb +415 -0
- data/lib/rouge/lexers/rust.rb +191 -0
- data/lib/rouge/lexers/sass.rb +74 -0
- data/lib/rouge/lexers/sass/common.rb +180 -0
- data/lib/rouge/lexers/scala.rb +142 -0
- data/lib/rouge/lexers/scheme.rb +112 -0
- data/lib/rouge/lexers/scss.rb +34 -0
- data/lib/rouge/lexers/sed.rb +170 -0
- data/lib/rouge/lexers/shell.rb +152 -0
- data/lib/rouge/lexers/slim.rb +228 -0
- data/lib/rouge/lexers/smalltalk.rb +116 -0
- data/lib/rouge/lexers/sml.rb +347 -0
- data/lib/rouge/lexers/sql.rb +140 -0
- data/lib/rouge/lexers/swift.rb +144 -0
- data/lib/rouge/lexers/tcl.rb +192 -0
- data/lib/rouge/lexers/tex.rb +72 -0
- data/lib/rouge/lexers/toml.rb +71 -0
- data/lib/rouge/lexers/tulip.rb +75 -0
- data/lib/rouge/lexers/vb.rb +164 -0
- data/lib/rouge/lexers/viml.rb +101 -0
- data/lib/rouge/lexers/viml/keywords.rb +12 -0
- data/lib/rouge/lexers/xml.rb +59 -0
- data/lib/rouge/lexers/yaml.rb +364 -0
- data/lib/rouge/plugins/redcarpet.rb +30 -0
- data/lib/rouge/regex_lexer.rb +439 -0
- data/lib/rouge/template_lexer.rb +22 -0
- data/lib/rouge/text_analyzer.rb +48 -0
- data/lib/rouge/theme.rb +195 -0
- data/lib/rouge/themes/base16.rb +130 -0
- data/lib/rouge/themes/colorful.rb +67 -0
- data/lib/rouge/themes/github.rb +71 -0
- data/lib/rouge/themes/molokai.rb +82 -0
- data/lib/rouge/themes/monokai.rb +92 -0
- data/lib/rouge/themes/monokai_sublime.rb +90 -0
- data/lib/rouge/themes/thankful_eyes.rb +71 -0
- data/lib/rouge/token.rb +182 -0
- data/lib/rouge/util.rb +101 -0
- data/lib/rouge/version.rb +7 -0
- metadata +231 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
AddDefaultCharset UTF-8
|
2
|
+
|
3
|
+
RewriteEngine On
|
4
|
+
|
5
|
+
# Serve gzipped version if available and accepted
|
6
|
+
AddEncoding x-gzip .gz
|
7
|
+
RewriteCond %{HTTP:Accept-Encoding} gzip
|
8
|
+
RewriteCond %{REQUEST_FILENAME}.gz -f
|
9
|
+
RewriteRule ^(.*)$ $1.gz [QSA,L]
|
10
|
+
<FilesMatch \.css\.gz$>
|
11
|
+
ForceType text/css
|
12
|
+
Header append Vary Accept-Encoding
|
13
|
+
</FilesMatch>
|
14
|
+
<FilesMatch \.js\.gz$>
|
15
|
+
ForceType application/javascript
|
16
|
+
Header append Vary Accept-Encoding
|
17
|
+
</FilesMatch>
|
18
|
+
<FilesMatch \.html\.gz$>
|
19
|
+
ForceType text/html
|
20
|
+
Header append Vary Accept-Encoding
|
21
|
+
</FilesMatch>
|
data/lib/rouge/demos/c
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
(defun square (x) (* x x))
|
data/lib/rouge/demos/cpp
ADDED
data/lib/rouge/demos/css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Enum.map([1,2,3], fn(x) -> x * 2 end)
|
data/lib/rouge/demos/erb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<title><%= @title %></title>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# language: en
|
2
|
+
Feature: Addition
|
3
|
+
In order to avoid silly mistakes
|
4
|
+
As a math idiot
|
5
|
+
I want to be told the sum of two numbers
|
6
|
+
|
7
|
+
Scenario Outline: Add two numbers
|
8
|
+
Given I have entered <input_1> into the calculator
|
9
|
+
And I have entered <input_2> into the calculator
|
10
|
+
When I press <button>
|
11
|
+
Then the result should be <output> on the screen
|
12
|
+
|
13
|
+
Examples:
|
14
|
+
| input_1 | input_2 | button | output |
|
15
|
+
| 20 | 30 | add | 50 |
|
16
|
+
| 2 | 5 | add | 7 |
|
17
|
+
| 0 | 40 | add | 40 |
|
data/lib/rouge/demos/go
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
POST /demo/submit/ HTTP/1.1
|
2
|
+
Host: rouge.jneen.net
|
3
|
+
Cache-Control: max-age=0
|
4
|
+
Origin: http://rouge.jayferd.us
|
5
|
+
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2)
|
6
|
+
AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
|
7
|
+
Content-Type: application/json
|
8
|
+
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
|
9
|
+
Referer: http://pygments.org/
|
10
|
+
Accept-Encoding: gzip,deflate,sdch
|
11
|
+
Accept-Language: en-US,en;q=0.8
|
12
|
+
Accept-Charset: windows-949,utf-8;q=0.7,*;q=0.3
|
13
|
+
|
14
|
+
{"name":"test","lang":"text","boring":true}
|
data/lib/rouge/demos/ini
ADDED
data/lib/rouge/demos/io
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
bottle := method(i,
|
2
|
+
if(i==0, return "no more bottles of beer")
|
3
|
+
if(i==1, return "1 bottle of beer")
|
4
|
+
return i asString .. " bottles of beer"
|
5
|
+
)
|
6
|
+
|
7
|
+
for(i, 99, 1, -1,
|
8
|
+
write(bottle(i), " on the wall, ", bottle(i), ",\n")
|
9
|
+
write("take one down, pass it around,\n")
|
10
|
+
write(bottle(i - 1), " on the wall.\n\n")
|
11
|
+
)
|
@@ -0,0 +1 @@
|
|
1
|
+
$(document).ready(function() { alert('ready!'); });
|
@@ -0,0 +1 @@
|
|
1
|
+
{ "one": 1, "two": 2, "null": null, "simple": true }
|
@@ -0,0 +1 @@
|
|
1
|
+
{ "one": 1, "two": 2, "null": null, "simple": true } // a simple json object
|
@@ -0,0 +1,20 @@
|
|
1
|
+
; copied from http://llvm.org/docs/LangRef.html#module-structure
|
2
|
+
; Declare the string constant as a global constant.
|
3
|
+
@.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
|
4
|
+
|
5
|
+
; External declaration of the puts function
|
6
|
+
declare i32 @puts(i8* nocapture) nounwind
|
7
|
+
|
8
|
+
; Definition of main function
|
9
|
+
define i32 @main() { ; i32()*
|
10
|
+
; Convert [13 x i8]* to i8 *...
|
11
|
+
%cast210 = getelementptr [13 x i8]* @.str, i64 0, i64 0
|
12
|
+
|
13
|
+
; Call puts function to write out the string to stdout.
|
14
|
+
call i32 @puts(i8* %cast210)
|
15
|
+
ret i32 0
|
16
|
+
}
|
17
|
+
|
18
|
+
; Named metadata
|
19
|
+
!1 = metadata !{i32 42}
|
20
|
+
!foo = !{!1, null}
|
data/lib/rouge/demos/lua
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
util = require "my.module"
|
2
|
+
|
3
|
+
a_table = {
|
4
|
+
foo: 'bar'
|
5
|
+
interpolated: "foo-#{other.stuff 2 + 3}"
|
6
|
+
"string": 2
|
7
|
+
do: 'keyword'
|
8
|
+
}
|
9
|
+
|
10
|
+
class MyClass extends SomeClass
|
11
|
+
new: (@init, arg2 = 'default') =>
|
12
|
+
@derived = @init + 2
|
13
|
+
super!
|
14
|
+
|
15
|
+
other: =>
|
16
|
+
@foo + 2
|
data/lib/rouge/demos/nim
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
import math,strutils
|
2
|
+
|
3
|
+
proc fixedWidth(input: string, minFieldSize: int):string {.inline.} =
|
4
|
+
# Note that field size is a minimum- will expand field if input
|
5
|
+
# string is larger
|
6
|
+
if input.startsWith("-"):
|
7
|
+
return(input & repeatchar(count=(abs(minFieldSize-len(input))),c=' '))
|
8
|
+
else:
|
9
|
+
return(" " & input & repeatchar(count=(abs(minFieldSize-len(input))-1),c=' '))
|
10
|
+
|
11
|
+
template mathOnInterval(lowbound,highbound:float,counts: int,p:proc) =
|
12
|
+
block:
|
13
|
+
var step: float = (highbound - lowbound)/(max(counts,1))
|
14
|
+
var current: float = lowbound
|
15
|
+
while current < highbound:
|
16
|
+
echo($fixedWidth($current,25) & ": " & $fixedWidth($p(current),25))
|
17
|
+
current += step
|
18
|
+
|
19
|
+
echo "Sine of theta from 0 to 2*PI by PI/12"
|
20
|
+
mathOnInterval(0.0,2.0*PI,12,sin)
|
21
|
+
echo("\n")
|
22
|
+
echo "Cosine of theta from 0 to 2*PI by PI/12"
|
23
|
+
mathOnInterval(0.0,2.0*PI,12,cos)
|
24
|
+
|
25
|
+
# The first example above is much the same as:
|
26
|
+
# for i in 1..100:
|
27
|
+
# echo($sin( (float(i)/100.0) * 2.0*PI ))
|
@@ -0,0 +1,12 @@
|
|
1
|
+
(* Binary tree with leaves carrying an integer. *)
|
2
|
+
type tree = Leaf of int | Node of tree * tree
|
3
|
+
|
4
|
+
let rec exists_leaf test tree =
|
5
|
+
match tree with
|
6
|
+
| Leaf v -> test v
|
7
|
+
| Node (left, right) ->
|
8
|
+
exists_leaf test left
|
9
|
+
|| exists_leaf test right
|
10
|
+
|
11
|
+
let has_even_leaf tree =
|
12
|
+
exists_leaf (fun n -> n mod 2 = 0) tree
|
data/lib/rouge/demos/php
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
plain text :)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Function Get-IPv4Scopes
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Read IPv4Scopes from an array of servers
|
5
|
+
.PARAMETER Servers
|
6
|
+
Specifies an array of servers
|
7
|
+
.EXAMPLE
|
8
|
+
Get-IPv4Scopes
|
9
|
+
|
10
|
+
Will prompt for all inputs
|
11
|
+
#>
|
12
|
+
{
|
13
|
+
[CmdletBinding()]
|
14
|
+
Param(
|
15
|
+
# 1
|
16
|
+
[parameter(
|
17
|
+
Mandatory=$true,
|
18
|
+
Position=0,
|
19
|
+
ValueFromPipelineByPropertyName=$true,
|
20
|
+
HelpMessage="Server List"
|
21
|
+
)]
|
22
|
+
[string[]]$Servers,
|
23
|
+
#2
|
24
|
+
[parameter(Mandatory=$false,ValueFromPipeline=$false)]
|
25
|
+
[bool]$Unique=$false
|
26
|
+
) #EndParam
|
27
|
+
|
28
|
+
Begin {}
|
29
|
+
|
30
|
+
Process {
|
31
|
+
$arrayJobs=@()
|
32
|
+
foreach ($server in $Servers) {
|
33
|
+
$arrayJobs+=Invoke-Command -ComputerName $server -scriptblock {Get-DhcpServerv4Scope} -AsJob
|
34
|
+
}
|
35
|
+
$complete=$false
|
36
|
+
while (-not $complete) {
|
37
|
+
$arrayJobsInProgress= $arrayJobs | Where-Object { $_.State -match 'running' }
|
38
|
+
if (-not $arrayJobsInProgress) { $complete=$true }
|
39
|
+
}
|
40
|
+
$Scopes=$arrayJobs|Receive-Job
|
41
|
+
$UniqueScopes=$Scopes|Sort-Object -Property ScopeId -Unique
|
42
|
+
}
|
43
|
+
|
44
|
+
End {
|
45
|
+
if ($Unique) { return $UniqueScopes }
|
46
|
+
else { return $Scopes }
|
47
|
+
}
|
48
|
+
|
49
|
+
} #end function
|