guides 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +3 -0
- data/bin/guides +6 -0
- data/guides.gemspec +32 -0
- data/lib/guides.rb +25 -0
- data/lib/guides/cli.rb +35 -0
- data/lib/guides/generator.rb +274 -0
- data/lib/guides/helpers.rb +55 -0
- data/lib/guides/indexer.rb +69 -0
- data/lib/guides/levenshtein.rb +31 -0
- data/lib/guides/new.rb +26 -0
- data/lib/guides/templates/assets/images/book_icon.gif +0 -0
- data/lib/guides/templates/assets/images/bullet.gif +0 -0
- data/lib/guides/templates/assets/images/chapters_icon.gif +0 -0
- data/lib/guides/templates/assets/images/check_bullet.gif +0 -0
- data/lib/guides/templates/assets/images/construction.png +0 -0
- data/lib/guides/templates/assets/images/construction.svg +123 -0
- data/lib/guides/templates/assets/images/credits_pic_blank.gif +0 -0
- data/lib/guides/templates/assets/images/edge_badge.png +0 -0
- data/lib/guides/templates/assets/images/feature_tile.gif +0 -0
- data/lib/guides/templates/assets/images/footer_tile.gif +0 -0
- data/lib/guides/templates/assets/images/grey_bullet.gif +0 -0
- data/lib/guides/templates/assets/images/header_backdrop.png +0 -0
- data/lib/guides/templates/assets/images/header_tile.gif +0 -0
- data/lib/guides/templates/assets/images/icons/README +5 -0
- data/lib/guides/templates/assets/images/icons/callouts/1.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/10.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/11.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/12.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/13.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/14.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/15.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/2.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/3.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/4.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/5.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/6.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/7.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/8.png +0 -0
- data/lib/guides/templates/assets/images/icons/callouts/9.png +0 -0
- data/lib/guides/templates/assets/images/icons/caution.png +0 -0
- data/lib/guides/templates/assets/images/icons/example.png +0 -0
- data/lib/guides/templates/assets/images/icons/home.png +0 -0
- data/lib/guides/templates/assets/images/icons/important.png +0 -0
- data/lib/guides/templates/assets/images/icons/next.png +0 -0
- data/lib/guides/templates/assets/images/icons/note.png +0 -0
- data/lib/guides/templates/assets/images/icons/prev.png +0 -0
- data/lib/guides/templates/assets/images/icons/tip.png +0 -0
- data/lib/guides/templates/assets/images/icons/up.png +0 -0
- data/lib/guides/templates/assets/images/icons/warning.png +0 -0
- data/lib/guides/templates/assets/images/nav_arrow.gif +0 -0
- data/lib/guides/templates/assets/images/tab_grey.gif +0 -0
- data/lib/guides/templates/assets/images/tab_info.gif +0 -0
- data/lib/guides/templates/assets/images/tab_note.gif +0 -0
- data/lib/guides/templates/assets/images/tab_red.gif +0 -0
- data/lib/guides/templates/assets/images/tab_yellow.gif +0 -0
- data/lib/guides/templates/assets/images/tab_yellow.png +0 -0
- data/lib/guides/templates/assets/javascripts/guides.js +9 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushAS3.js +59 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +75 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushBash.js +59 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +65 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +100 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushCpp.js +97 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushCss.js +91 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +55 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushDiff.js +41 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushErlang.js +52 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +67 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushJScript.js +52 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushJava.js +57 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +58 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushPerl.js +72 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushPhp.js +88 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushPlain.js +33 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +74 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushPython.js +64 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushRuby.js +55 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushSass.js +94 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushScala.js +51 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushSql.js +66 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushVb.js +56 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shBrushXml.js +69 -0
- data/lib/guides/templates/assets/javascripts/syntaxhighlighter/shCore.js +17 -0
- data/lib/guides/templates/assets/stylesheets/main.css +445 -0
- data/lib/guides/templates/assets/stylesheets/print.css +52 -0
- data/lib/guides/templates/assets/stylesheets/reset.css +43 -0
- data/lib/guides/templates/assets/stylesheets/style.css +13 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCore.css +226 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +328 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +331 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +339 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +324 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +324 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +324 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +324 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +117 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +120 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +128 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +113 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +113 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +113 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +113 -0
- data/lib/guides/templates/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +116 -0
- data/lib/guides/templates/guides.yml.tt +35 -0
- data/lib/guides/templates/source/_clickable_index.html.erb +17 -0
- data/lib/guides/templates/source/_full_index.html.erb +16 -0
- data/lib/guides/templates/source/_sections.html.erb +24 -0
- data/lib/guides/templates/source/contribute.textile +47 -0
- data/lib/guides/templates/source/credits.html.erb +21 -0
- data/lib/guides/templates/source/index.html.erb +1 -0
- data/lib/guides/templates/source/layout.html.erb +82 -0
- data/lib/guides/textile_extensions.rb +39 -0
- data/lib/guides/version.rb +3 -0
- data/lib/guides/w3c_validator.rb +89 -0
- metadata +257 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
module Guides
|
2
|
+
module Levenshtein
|
3
|
+
# Based on the pseudocode in http://en.wikipedia.org/wiki/Levenshtein_distance.
|
4
|
+
def self.distance(s1, s2)
|
5
|
+
s = s1.unpack('U*')
|
6
|
+
t = s2.unpack('U*')
|
7
|
+
m = s.length
|
8
|
+
n = t.length
|
9
|
+
|
10
|
+
# matrix initialization
|
11
|
+
d = []
|
12
|
+
0.upto(m) { |i| d << [i] }
|
13
|
+
0.upto(n) { |j| d[0][j] = j }
|
14
|
+
|
15
|
+
# distance computation
|
16
|
+
1.upto(m) do |i|
|
17
|
+
1.upto(n) do |j|
|
18
|
+
cost = s[i] == t[j] ? 0 : 1
|
19
|
+
d[i][j] = [
|
20
|
+
d[i-1][j] + 1, # deletion
|
21
|
+
d[i][j-1] + 1, # insertion
|
22
|
+
d[i-1][j-1] + cost, # substitution
|
23
|
+
].min
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# all done
|
28
|
+
return d[m][n]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/guides/new.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Guides
|
2
|
+
class New < Thor
|
3
|
+
include Thor::Actions
|
4
|
+
|
5
|
+
source_root File.expand_path("../templates", __FILE__)
|
6
|
+
|
7
|
+
desc "copy DEST NAME", "copy stuff"
|
8
|
+
def copy(destination, name)
|
9
|
+
self.destination_root = File.expand_path(destination)
|
10
|
+
self.title = name
|
11
|
+
|
12
|
+
directory "source"
|
13
|
+
empty_directory "assets/stylesheets"
|
14
|
+
empty_directory "assets/images"
|
15
|
+
empty_directory "assets/javascripts"
|
16
|
+
|
17
|
+
template "guides.yml.tt", "guides.yml"
|
18
|
+
create_file "assets/stylesheets/overrides.style.css"
|
19
|
+
create_file "assets/stylesheets/overrides.print.css"
|
20
|
+
end
|
21
|
+
|
22
|
+
no_tasks do
|
23
|
+
attr_accessor :title
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,123 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
|
3
|
+
<svg
|
4
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
5
|
+
xmlns:cc="http://web.resource.org/cc/"
|
6
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
7
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
9
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
10
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
11
|
+
version="1.0"
|
12
|
+
x="0"
|
13
|
+
y="0"
|
14
|
+
width="560pt"
|
15
|
+
height="490pt"
|
16
|
+
id="svg602"
|
17
|
+
xml:space="preserve"
|
18
|
+
sodipodi:version="0.32"
|
19
|
+
sodipodi:docname="Baustelle.svg"
|
20
|
+
sodipodi:docbase="C:\Documents and Settings\Administrator\Desktop\Commons"
|
21
|
+
inkscape:version="0.45"
|
22
|
+
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
23
|
+
sodipodi:modified="true"><metadata
|
24
|
+
id="metadata2244"><rdf:RDF><cc:Work
|
25
|
+
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
26
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><sodipodi:namedview
|
27
|
+
id="base"
|
28
|
+
inkscape:zoom="0.87046288"
|
29
|
+
inkscape:cx="355.51579"
|
30
|
+
inkscape:cy="289.20644"
|
31
|
+
inkscape:window-width="1280"
|
32
|
+
inkscape:window-height="964"
|
33
|
+
inkscape:window-x="-4"
|
34
|
+
inkscape:window-y="-4"
|
35
|
+
inkscape:current-layer="svg602" /><defs
|
36
|
+
id="defs604" /><path
|
37
|
+
d="M 651.8229 589.4901 L 43.58339 589.943 C 19.8097 589.9607 9.80696 565.7213 23.80069 542.0037 L 316.0161 46.74347 C 332.7052 19.26017 363.6447 18.96107 380.3337 47.67127 L 675.9025 541.5504 C 692.1616 565.1324 680.3398 589.9128 651.8229 589.4901 z "
|
38
|
+
style="font-size:12;fill:#ea0000;fill-rule:evenodd;"
|
39
|
+
id="path634" /><path
|
40
|
+
style="font-size:12;fill:#ffffff;fill-rule:evenodd;"
|
41
|
+
d="M 347.28125 98.5 L 249.59375 259.09375 L 88.3125 536.03125 L 282.125 537.90625 L 612.78125 535.15625 L 516.625 372.6875 L 347.28125 98.5 z "
|
42
|
+
id="polygon611" /><path
|
43
|
+
d="M 590.3589 519.1232 L 344.7437 519.439 C 342.5189 519.2382 340.9074 518.7307 341.7497 516.0762 L 432.0002 400.3881 C 435.1214 395.9648 439.8303 393.5731 444.5677 393.7091 L 489.919 393.6123 C 497.2741 393.6089 500.1103 395.738 504.1575 400.8197 L 592.5329 514.9399 C 593.3417 516.9477 592.617 518.9555 590.3589 519.1232 z "
|
44
|
+
style="font-size:12;fill-rule:evenodd;"
|
45
|
+
id="path633" /><rect
|
46
|
+
width="62.1417105"
|
47
|
+
height="124.684113"
|
48
|
+
rx="11.2045486"
|
49
|
+
ry="11.816922"
|
50
|
+
x="401.592033"
|
51
|
+
y="86.9191542"
|
52
|
+
transform="matrix(0.885449,0.464736,-0.408053,0.912958,0,0)"
|
53
|
+
style="font-size:12;fill:#000002;fill-rule:evenodd;"
|
54
|
+
id="rect613" /><rect
|
55
|
+
width="100.000008"
|
56
|
+
height="32.5"
|
57
|
+
rx="9.4117651"
|
58
|
+
ry="8"
|
59
|
+
x="266.614166"
|
60
|
+
y="268.593887"
|
61
|
+
style="font-size:12;fill-rule:evenodd;"
|
62
|
+
id="rect615" /><rect
|
63
|
+
width="93.1918213"
|
64
|
+
height="27.6430168"
|
65
|
+
rx="8.77099663"
|
66
|
+
ry="6.80443525"
|
67
|
+
x="-111.084468"
|
68
|
+
y="374.948372"
|
69
|
+
transform="matrix(0.46869,-0.883363,0.744635,0.667472,0,0)"
|
70
|
+
style="font-size:12;fill-rule:evenodd;"
|
71
|
+
id="rect616" /><rect
|
72
|
+
width="292.533896"
|
73
|
+
height="15.5059239"
|
74
|
+
rx="27.5326014"
|
75
|
+
ry="3.81684275"
|
76
|
+
x="361.496547"
|
77
|
+
y="184.7349"
|
78
|
+
transform="matrix(0.884585,0.466378,-0.436681,0.899616,0,0)"
|
79
|
+
style="font-size:12;fill-rule:evenodd;"
|
80
|
+
id="rect617" /><rect
|
81
|
+
width="134.95171"
|
82
|
+
height="27.030939"
|
83
|
+
rx="12.701341"
|
84
|
+
ry="6.6537695"
|
85
|
+
x="-440.25488"
|
86
|
+
y="335.38721"
|
87
|
+
transform="matrix(-5.7205843e-2,-0.9983624,0.9970356,-7.6942196e-2,0,0)"
|
88
|
+
style="font-size:12px;fill-rule:evenodd"
|
89
|
+
id="rect618" /><ellipse
|
90
|
+
cx="418.75"
|
91
|
+
cy="467.362183"
|
92
|
+
rx="31.25"
|
93
|
+
ry="32.5"
|
94
|
+
transform="matrix(0.957573,0,0,0.972804,-15.17769,-201.0577)"
|
95
|
+
style="font-size:12;fill-rule:evenodd;stroke-width:1;"
|
96
|
+
id="path619" /><rect
|
97
|
+
width="78.0662926"
|
98
|
+
height="31.2361202"
|
99
|
+
rx="7.34741553"
|
100
|
+
ry="7.6888919"
|
101
|
+
x="-504.121404"
|
102
|
+
y="192.695264"
|
103
|
+
transform="matrix(-0.234008,-0.972235,0.985645,-0.16883,0,0)"
|
104
|
+
style="font-size:12;fill-rule:evenodd;"
|
105
|
+
id="rect621" /><rect
|
106
|
+
width="78.2401745"
|
107
|
+
height="31.2458291"
|
108
|
+
rx="7.36378059"
|
109
|
+
ry="7.69128233"
|
110
|
+
x="-494.049012"
|
111
|
+
y="303.844892"
|
112
|
+
transform="matrix(-7.569861e-3,-0.999971,0.997034,7.696708e-2,0,0)"
|
113
|
+
style="font-size:12;fill-rule:evenodd;"
|
114
|
+
id="rect622" /><rect
|
115
|
+
width="156.705855"
|
116
|
+
height="31.9531957"
|
117
|
+
rx="14.7487878"
|
118
|
+
ry="7.86540322"
|
119
|
+
x="-296.654358"
|
120
|
+
y="424.44891"
|
121
|
+
transform="matrix(0.494708,-0.869059,0.817867,0.575407,0,0)"
|
122
|
+
style="font-size:12;fill-rule:evenodd;"
|
123
|
+
id="rect623" /></svg>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
function guideMenu(){
|
2
|
+
if (document.getElementById('guides').style.display == "none") {
|
3
|
+
document.getElementById('guides').style.display = "block";
|
4
|
+
document.getElementById('guidesArrow').innerHTML = "▾";
|
5
|
+
} else {
|
6
|
+
document.getElementById('guides').style.display = "none";
|
7
|
+
document.getElementById('guidesArrow').innerHTML = "▸";
|
8
|
+
}
|
9
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
// Created by Peter Atoria @ http://iAtoria.com
|
25
|
+
|
26
|
+
var inits = 'class interface function package';
|
27
|
+
|
28
|
+
var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
|
29
|
+
'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
|
30
|
+
'extends false final finally flash_proxy for get if implements import in include Infinity ' +
|
31
|
+
'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
|
32
|
+
'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
|
33
|
+
'return set static String super switch this throw true try typeof uint undefined unescape ' +
|
34
|
+
'use void while with'
|
35
|
+
;
|
36
|
+
|
37
|
+
this.regexList = [
|
38
|
+
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
39
|
+
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
40
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
41
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
42
|
+
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
|
43
|
+
{ regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
|
44
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
45
|
+
{ regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
|
46
|
+
{ regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
|
47
|
+
];
|
48
|
+
|
49
|
+
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
|
50
|
+
};
|
51
|
+
|
52
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
53
|
+
Brush.aliases = ['actionscript3', 'as3'];
|
54
|
+
|
55
|
+
SyntaxHighlighter.brushes.AS3 = Brush;
|
56
|
+
|
57
|
+
// CommonJS
|
58
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
59
|
+
})();
|
@@ -0,0 +1,75 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
// AppleScript brush by David Chambers
|
25
|
+
// http://davidchambersdesign.com/
|
26
|
+
var keywords = 'after before beginning continue copy each end every from return get global in local named of set some that the then times to where whose with without';
|
27
|
+
var ordinals = 'first second third fourth fifth sixth seventh eighth ninth tenth last front back middle';
|
28
|
+
var specials = 'activate add alias AppleScript ask attachment boolean class constant delete duplicate empty exists false id integer list make message modal modified new no paragraph pi properties quit real record remove rest result reveal reverse run running save string true word yes';
|
29
|
+
|
30
|
+
this.regexList = [
|
31
|
+
|
32
|
+
{ regex: /(--|#).*$/gm,
|
33
|
+
css: 'comments' },
|
34
|
+
|
35
|
+
{ regex: /\(\*(?:[\s\S]*?\(\*[\s\S]*?\*\))*[\s\S]*?\*\)/gm, // support nested comments
|
36
|
+
css: 'comments' },
|
37
|
+
|
38
|
+
{ regex: /"[\s\S]*?"/gm,
|
39
|
+
css: 'string' },
|
40
|
+
|
41
|
+
{ regex: /(?:,|:|¬|'s\b|\(|\)|\{|\}|«|\b\w*»)/g,
|
42
|
+
css: 'color1' },
|
43
|
+
|
44
|
+
{ regex: /(-)?(\d)+(\.(\d)?)?(E\+(\d)+)?/g, // numbers
|
45
|
+
css: 'color1' },
|
46
|
+
|
47
|
+
{ regex: /(?:&(amp;|gt;|lt;)?|=|� |>|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g,
|
48
|
+
css: 'color2' },
|
49
|
+
|
50
|
+
{ regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g,
|
51
|
+
css: 'keyword' },
|
52
|
+
|
53
|
+
{ regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals
|
54
|
+
css: 'keyword' },
|
55
|
+
|
56
|
+
{ regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g,
|
57
|
+
css: 'color3' },
|
58
|
+
|
59
|
+
{ regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
|
60
|
+
css: 'color3' },
|
61
|
+
|
62
|
+
{ regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' },
|
63
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
|
64
|
+
{ regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' }
|
65
|
+
];
|
66
|
+
};
|
67
|
+
|
68
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
69
|
+
Brush.aliases = ['applescript'];
|
70
|
+
|
71
|
+
SyntaxHighlighter.brushes.AppleScript = Brush;
|
72
|
+
|
73
|
+
// CommonJS
|
74
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
75
|
+
})();
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le';
|
25
|
+
var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
|
26
|
+
'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
|
27
|
+
'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
|
28
|
+
'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
|
29
|
+
'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
|
30
|
+
'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
|
31
|
+
'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
|
32
|
+
'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
|
33
|
+
'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
|
34
|
+
'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
|
35
|
+
'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
|
36
|
+
'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
|
37
|
+
'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
|
38
|
+
'vi watch wc whereis which who whoami Wget xargs yes'
|
39
|
+
;
|
40
|
+
|
41
|
+
this.regexList = [
|
42
|
+
{ regex: /^#!.*$/gm, css: 'preprocessor bold' },
|
43
|
+
{ regex: /\/[\w-\/]+/gm, css: 'plain' },
|
44
|
+
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
|
45
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
46
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
47
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
48
|
+
{ regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
|
49
|
+
];
|
50
|
+
}
|
51
|
+
|
52
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
53
|
+
Brush.aliases = ['bash', 'shell'];
|
54
|
+
|
55
|
+
SyntaxHighlighter.brushes.Bash = Brush;
|
56
|
+
|
57
|
+
// CommonJS
|
58
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
59
|
+
})();
|