gentelella-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +107 -0
- data/Rakefile +30 -0
- data/assets/javascripts/autosize.js +254 -0
- data/assets/javascripts/bootstrap-progressbar.js +168 -0
- data/assets/javascripts/bootstrap-wysiwyg.js +306 -0
- data/assets/javascripts/data_tables.coffee +12 -0
- data/assets/javascripts/data_tables/jquery.data_tables.js +15277 -0
- data/assets/javascripts/data_tables/net-bs.bootstrap.js +182 -0
- data/assets/javascripts/data_tables/net-buttons-bs.buttons.js +68 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.flash.js +1325 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.html5.js +1322 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.js +1634 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.print.js +172 -0
- data/assets/javascripts/data_tables/net-fixedheader.js +672 -0
- data/assets/javascripts/data_tables/net-keytable.js +883 -0
- data/assets/javascripts/data_tables/net-responsive-bs.js +81 -0
- data/assets/javascripts/data_tables/net-responsive.js +1232 -0
- data/assets/javascripts/data_tables/net-scroller.js +1349 -0
- data/assets/javascripts/echarts.js +56282 -0
- data/assets/javascripts/echarts.map.world.js +27 -0
- data/assets/javascripts/fullcalendar.js +14206 -0
- data/assets/javascripts/gauge.coffee +524 -0
- data/assets/javascripts/gentelella.coffee +50 -0
- data/assets/javascripts/jquery.autocomplete.js +979 -0
- data/assets/javascripts/jquery.easypiechart.js +360 -0
- data/assets/javascripts/jquery.flot.curvedLines.js +483 -0
- data/assets/javascripts/jquery.flot.curved_lines.js +483 -0
- data/assets/javascripts/jquery.flot.orderBars.js +201 -0
- data/assets/javascripts/jquery.flot.order_bars.js +201 -0
- data/assets/javascripts/jquery.flot.spline.js +212 -0
- data/assets/javascripts/jquery.hotkeys.js +204 -0
- data/assets/javascripts/jquery.mCustomScrollbar.concat.min.js +6 -0
- data/assets/javascripts/jquery.mCustomScrollbar.js +2425 -0
- data/assets/javascripts/jquery.sparkline.js +3063 -0
- data/assets/javascripts/jquery.tagsinput.js +390 -0
- data/assets/javascripts/jquery.vmap.js +1281 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.africa.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.asia.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.australia.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.europe.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.north-america.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.south-america.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.algeria.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.argentina.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.brazil.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.canada.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.europe.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.france.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.germany.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.greece.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.iran.js +6 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.iraq.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.russia.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.tunisia.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.turkey.js +11 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.usa.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.world.js +2 -0
- data/assets/javascripts/jszip.js +9344 -0
- data/assets/javascripts/morris.js +1892 -0
- data/assets/javascripts/parsley.js.map +1 -0
- data/assets/javascripts/pdfmake.js +68149 -0
- data/assets/javascripts/pnotify.buttons.js +8 -0
- data/assets/javascripts/pnotify.js +31 -0
- data/assets/javascripts/pnotify.nonblock.js +6 -0
- data/assets/javascripts/prettify.coffee +29 -0
- data/assets/javascripts/prettify/lang-apollo.js +51 -0
- data/assets/javascripts/prettify/lang-basic.js +32 -0
- data/assets/javascripts/prettify/lang-clj.js +64 -0
- data/assets/javascripts/prettify/lang-css.js +159 -0
- data/assets/javascripts/prettify/lang-dart.js +88 -0
- data/assets/javascripts/prettify/lang-erlang.js +92 -0
- data/assets/javascripts/prettify/lang-go.js +58 -0
- data/assets/javascripts/prettify/lang-hs.js +101 -0
- data/assets/javascripts/prettify/lang-lisp.js +94 -0
- data/assets/javascripts/prettify/lang-llvm.js +61 -0
- data/assets/javascripts/prettify/lang-lua.js +59 -0
- data/assets/javascripts/prettify/lang-matlab.js +180 -0
- data/assets/javascripts/prettify/lang-ml.js +56 -0
- data/assets/javascripts/prettify/lang-mumps.js +139 -0
- data/assets/javascripts/prettify/lang-n.js +65 -0
- data/assets/javascripts/prettify/lang-pascal.js +32 -0
- data/assets/javascripts/prettify/lang-proto.js +35 -0
- data/assets/javascripts/prettify/lang-r.js +57 -0
- data/assets/javascripts/prettify/lang-rd.js +47 -0
- data/assets/javascripts/prettify/lang-scala.js +54 -0
- data/assets/javascripts/prettify/lang-sql.js +58 -0
- data/assets/javascripts/prettify/lang-tcl.js +62 -0
- data/assets/javascripts/prettify/lang-tex.js +46 -0
- data/assets/javascripts/prettify/lang-vb.js +66 -0
- data/assets/javascripts/prettify/lang-vhdl.js +34 -0
- data/assets/javascripts/prettify/lang-wiki.js +53 -0
- data/assets/javascripts/prettify/lang-xq.js +67 -0
- data/assets/javascripts/prettify/lang-yaml.js +27 -0
- data/assets/javascripts/prettify/prettify.js +1655 -0
- data/assets/javascripts/prettify/run_prettify.js +1905 -0
- data/assets/javascripts/raphael.js +8330 -0
- data/assets/javascripts/skycons.js +730 -0
- data/assets/javascripts/starrr.js +98 -0
- data/assets/javascripts/vfs_fonts.js +1 -0
- data/assets/stylesheets/bootstrap-progressbar-3.3.0-3.x.x.scss +74 -0
- data/assets/stylesheets/bootstrap-wysiwyg.css +88 -0
- data/assets/stylesheets/data_tables/net-bs.bootstrap.css +185 -0
- data/assets/stylesheets/data_tables/net-buttons-bs.buttons.css +102 -0
- data/assets/stylesheets/data_tables/net-fixedheader-bs.bootstrap.css +20 -0
- data/assets/stylesheets/data_tables/net-responsive-bs.bootstrap.css +181 -0
- data/assets/stylesheets/data_tables/net-scroller-bs.bootstrap.css +24 -0
- data/assets/stylesheets/fullcalendar.css +1406 -0
- data/assets/stylesheets/fullcalendar.print.css +208 -0
- data/assets/stylesheets/gentelella.scss +39 -0
- data/assets/stylesheets/jquery.mCustomScrollbar.css +1267 -0
- data/assets/stylesheets/jqvmap.css +50 -0
- data/assets/stylesheets/morris.css +2 -0
- data/assets/stylesheets/pnotify.buttons.css +1 -0
- data/assets/stylesheets/pnotify.css +1 -0
- data/assets/stylesheets/pnotify.nonblock.css +1 -0
- data/assets/stylesheets/prettify/prettify.css +52 -0
- data/assets/stylesheets/starrr.css +8 -0
- data/lib/generators/gentelella/install/USAGE +9 -0
- data/lib/generators/gentelella/install/install_generator.rb +14 -0
- data/lib/generators/gentelella/install/templates/gentelella-custom.js +5067 -0
- data/lib/generators/gentelella/install/templates/gentelella-custom.scss +4241 -0
- data/lib/gentelella-rails.rb +58 -0
- data/lib/gentelella/engine.rb +15 -0
- data/lib/gentelella/version.rb +3 -0
- data/lib/tasks/bower.rake +153 -0
- data/lib/tasks/gentelella/rails_tasks.rake +4 -0
- metadata +409 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
// Copyright (C) 2013 Andrew Allen
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @fileoverview
|
18
|
+
* Registers a language handler for Erlang.
|
19
|
+
*
|
20
|
+
* Derived from https://raw.github.com/erlang/otp/dev/lib/compiler/src/core_parse.yrl
|
21
|
+
* Modified from Mike Samuel's Haskell plugin for google-code-prettify
|
22
|
+
*
|
23
|
+
* @author achew22@gmail.com
|
24
|
+
*/
|
25
|
+
|
26
|
+
PR['registerLangHandler'](
|
27
|
+
PR['createSimpleLexer'](
|
28
|
+
[
|
29
|
+
// Whitespace
|
30
|
+
// whitechar -> newline | vertab | space | tab | uniWhite
|
31
|
+
// newline -> return linefeed | return | linefeed | formfeed
|
32
|
+
[PR['PR_PLAIN'], /^[\t\n\x0B\x0C\r ]+/, null, '\t\n\x0B\x0C\r '],
|
33
|
+
// Single line double-quoted strings.
|
34
|
+
[PR['PR_STRING'], /^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,
|
35
|
+
null, '"'],
|
36
|
+
|
37
|
+
// Handle atoms
|
38
|
+
[PR['PR_LITERAL'], /^[a-z][a-zA-Z0-9_]*/],
|
39
|
+
// Handle single quoted atoms
|
40
|
+
[PR['PR_LITERAL'], /^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,
|
41
|
+
null, "'"],
|
42
|
+
|
43
|
+
// Handle macros. Just to be extra clear on this one, it detects the ?
|
44
|
+
// then uses the regexp to end it so be very careful about matching
|
45
|
+
// all the terminal elements
|
46
|
+
[PR['PR_LITERAL'], /^\?[^ \t\n({]+/, null, "?"],
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
// decimal -> digit{digit}
|
51
|
+
// octal -> octit{octit}
|
52
|
+
// hexadecimal -> hexit{hexit}
|
53
|
+
// integer -> decimal
|
54
|
+
// | 0o octal | 0O octal
|
55
|
+
// | 0x hexadecimal | 0X hexadecimal
|
56
|
+
// float -> decimal . decimal [exponent]
|
57
|
+
// | decimal exponent
|
58
|
+
// exponent -> (e | E) [+ | -] decimal
|
59
|
+
[PR['PR_LITERAL'],
|
60
|
+
/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,
|
61
|
+
null, '0123456789']
|
62
|
+
],
|
63
|
+
[
|
64
|
+
// TODO: catch @declarations inside comments
|
65
|
+
|
66
|
+
// Comments in erlang are started with % and go till a newline
|
67
|
+
[PR['PR_COMMENT'], /^%[^\n]*/],
|
68
|
+
|
69
|
+
// Catch macros
|
70
|
+
//[PR['PR_TAG'], /?[^( \n)]+/],
|
71
|
+
|
72
|
+
/**
|
73
|
+
* %% Keywords (atoms are assumed to always be single-quoted).
|
74
|
+
* 'module' 'attributes' 'do' 'let' 'in' 'letrec'
|
75
|
+
* 'apply' 'call' 'primop'
|
76
|
+
* 'case' 'of' 'end' 'when' 'fun' 'try' 'catch' 'receive' 'after'
|
77
|
+
*/
|
78
|
+
[PR['PR_KEYWORD'], /^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/],
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Catch definitions (usually defined at the top of the file)
|
82
|
+
* Anything that starts -something
|
83
|
+
*/
|
84
|
+
[PR['PR_KEYWORD'], /^-[a-z_]+/],
|
85
|
+
|
86
|
+
// Catch variables
|
87
|
+
[PR['PR_TYPE'], /^[A-Z_][a-zA-Z0-9_]*/],
|
88
|
+
|
89
|
+
// matches the symbol production
|
90
|
+
[PR['PR_PUNCTUATION'], /^[.,;]/]
|
91
|
+
]),
|
92
|
+
['erlang', 'erl']);
|
@@ -0,0 +1,58 @@
|
|
1
|
+
// Copyright (C) 2010 Google Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @fileoverview
|
19
|
+
* Registers a language handler for the Go language..
|
20
|
+
* <p>
|
21
|
+
* Based on the lexical grammar at
|
22
|
+
* http://golang.org/doc/go_spec.html#Lexical_elements
|
23
|
+
* <p>
|
24
|
+
* Go uses a minimal style for highlighting so the below does not distinguish
|
25
|
+
* strings, keywords, literals, etc. by design.
|
26
|
+
* From a discussion with the Go designers:
|
27
|
+
* <pre>
|
28
|
+
* On Thursday, July 22, 2010, Mike Samuel <...> wrote:
|
29
|
+
* > On Thu, Jul 22, 2010, Rob 'Commander' Pike <...> wrote:
|
30
|
+
* >> Personally, I would vote for the subdued style godoc presents at http://golang.org
|
31
|
+
* >>
|
32
|
+
* >> Not as fancy as some like, but a case can be made it's the official style.
|
33
|
+
* >> If people want more colors, I wouldn't fight too hard, in the interest of
|
34
|
+
* >> encouragement through familiarity, but even then I would ask to shy away
|
35
|
+
* >> from technicolor starbursts.
|
36
|
+
* >
|
37
|
+
* > Like http://golang.org/pkg/go/scanner/ where comments are blue and all
|
38
|
+
* > other content is black? I can do that.
|
39
|
+
* </pre>
|
40
|
+
*
|
41
|
+
* @author mikesamuel@gmail.com
|
42
|
+
*/
|
43
|
+
|
44
|
+
PR['registerLangHandler'](
|
45
|
+
PR['createSimpleLexer'](
|
46
|
+
[
|
47
|
+
// Whitespace is made up of spaces, tabs and newline characters.
|
48
|
+
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
49
|
+
// Not escaped as a string. See note on minimalism above.
|
50
|
+
[PR['PR_PLAIN'], /^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/, null, '"\'']
|
51
|
+
],
|
52
|
+
[
|
53
|
+
// Block comments are delimited by /* and */.
|
54
|
+
// Single-line comments begin with // and extend to the end of a line.
|
55
|
+
[PR['PR_COMMENT'], /^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/],
|
56
|
+
[PR['PR_PLAIN'], /^(?:[^\/\"\'`]|\/(?![\/\*]))+/i]
|
57
|
+
]),
|
58
|
+
['go']);
|
@@ -0,0 +1,101 @@
|
|
1
|
+
// Copyright (C) 2009 Google Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @fileoverview
|
19
|
+
* Registers a language handler for Haskell.
|
20
|
+
*
|
21
|
+
*
|
22
|
+
* To use, include prettify.js and this file in your HTML page.
|
23
|
+
* Then put your code in an HTML tag like
|
24
|
+
* <pre class="prettyprint lang-hs">(my lisp code)</pre>
|
25
|
+
* The lang-cl class identifies the language as common lisp.
|
26
|
+
* This file supports the following language extensions:
|
27
|
+
* lang-cl - Common Lisp
|
28
|
+
* lang-el - Emacs Lisp
|
29
|
+
* lang-lisp - Lisp
|
30
|
+
* lang-scm - Scheme
|
31
|
+
*
|
32
|
+
*
|
33
|
+
* I used http://www.informatik.uni-freiburg.de/~thiemann/haskell/haskell98-report-html/syntax-iso.html
|
34
|
+
* as the basis, but ignore the way the ncomment production nests since this
|
35
|
+
* makes the lexical grammar irregular. It might be possible to support
|
36
|
+
* ncomments using the lookbehind filter.
|
37
|
+
*
|
38
|
+
*
|
39
|
+
* @author mikesamuel@gmail.com
|
40
|
+
*/
|
41
|
+
|
42
|
+
PR['registerLangHandler'](
|
43
|
+
PR['createSimpleLexer'](
|
44
|
+
[
|
45
|
+
// Whitespace
|
46
|
+
// whitechar -> newline | vertab | space | tab | uniWhite
|
47
|
+
// newline -> return linefeed | return | linefeed | formfeed
|
48
|
+
[PR['PR_PLAIN'], /^[\t\n\x0B\x0C\r ]+/, null, '\t\n\x0B\x0C\r '],
|
49
|
+
// Single line double and single-quoted strings.
|
50
|
+
// char -> ' (graphic<' | \> | space | escape<\&>) '
|
51
|
+
// string -> " {graphic<" | \> | space | escape | gap}"
|
52
|
+
// escape -> \ ( charesc | ascii | decimal | o octal
|
53
|
+
// | x hexadecimal )
|
54
|
+
// charesc -> a | b | f | n | r | t | v | \ | " | ' | &
|
55
|
+
[PR['PR_STRING'], /^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,
|
56
|
+
null, '"'],
|
57
|
+
[PR['PR_STRING'], /^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,
|
58
|
+
null, "'"],
|
59
|
+
// decimal -> digit{digit}
|
60
|
+
// octal -> octit{octit}
|
61
|
+
// hexadecimal -> hexit{hexit}
|
62
|
+
// integer -> decimal
|
63
|
+
// | 0o octal | 0O octal
|
64
|
+
// | 0x hexadecimal | 0X hexadecimal
|
65
|
+
// float -> decimal . decimal [exponent]
|
66
|
+
// | decimal exponent
|
67
|
+
// exponent -> (e | E) [+ | -] decimal
|
68
|
+
[PR['PR_LITERAL'],
|
69
|
+
/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,
|
70
|
+
null, '0123456789']
|
71
|
+
],
|
72
|
+
[
|
73
|
+
// Haskell does not have a regular lexical grammar due to the nested
|
74
|
+
// ncomment.
|
75
|
+
// comment -> dashes [ any<symbol> {any}] newline
|
76
|
+
// ncomment -> opencom ANYseq {ncomment ANYseq}closecom
|
77
|
+
// dashes -> '--' {'-'}
|
78
|
+
// opencom -> '{-'
|
79
|
+
// closecom -> '-}'
|
80
|
+
[PR['PR_COMMENT'], /^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],
|
81
|
+
// reservedid -> case | class | data | default | deriving | do
|
82
|
+
// | else | if | import | in | infix | infixl | infixr
|
83
|
+
// | instance | let | module | newtype | of | then
|
84
|
+
// | type | where | _
|
85
|
+
[PR['PR_KEYWORD'], /^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, null],
|
86
|
+
// qvarid -> [ modid . ] varid
|
87
|
+
// qconid -> [ modid . ] conid
|
88
|
+
// varid -> (small {small | large | digit | ' })<reservedid>
|
89
|
+
// conid -> large {small | large | digit | ' }
|
90
|
+
// modid -> conid
|
91
|
+
// small -> ascSmall | uniSmall | _
|
92
|
+
// ascSmall -> a | b | ... | z
|
93
|
+
// uniSmall -> any Unicode lowercase letter
|
94
|
+
// large -> ascLarge | uniLarge
|
95
|
+
// ascLarge -> A | B | ... | Z
|
96
|
+
// uniLarge -> any uppercase or titlecase Unicode letter
|
97
|
+
[PR['PR_PLAIN'], /^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],
|
98
|
+
// matches the symbol production
|
99
|
+
[PR['PR_PUNCTUATION'], /^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]
|
100
|
+
]),
|
101
|
+
['hs']);
|
@@ -0,0 +1,94 @@
|
|
1
|
+
// Copyright (C) 2008 Google Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @fileoverview
|
19
|
+
* Registers a language handler for Common Lisp and related languages.
|
20
|
+
*
|
21
|
+
*
|
22
|
+
* To use, include prettify.js and this file in your HTML page.
|
23
|
+
* Then put your code in an HTML tag like
|
24
|
+
* <pre class="prettyprint lang-lisp">(my lisp code)</pre>
|
25
|
+
* The lang-cl class identifies the language as common lisp.
|
26
|
+
* This file supports the following language extensions:
|
27
|
+
* lang-cl - Common Lisp
|
28
|
+
* lang-el - Emacs Lisp
|
29
|
+
* lang-lisp - Lisp
|
30
|
+
* lang-scm - Scheme
|
31
|
+
* lang-lsp - FAT 8.3 filename version of lang-lisp.
|
32
|
+
*
|
33
|
+
*
|
34
|
+
* I used http://www.devincook.com/goldparser/doc/meta-language/grammar-LISP.htm
|
35
|
+
* as the basis, but added line comments that start with ; and changed the atom
|
36
|
+
* production to disallow unquoted semicolons.
|
37
|
+
*
|
38
|
+
* "Name" = 'LISP'
|
39
|
+
* "Author" = 'John McCarthy'
|
40
|
+
* "Version" = 'Minimal'
|
41
|
+
* "About" = 'LISP is an abstract language that organizes ALL'
|
42
|
+
* | 'data around "lists".'
|
43
|
+
*
|
44
|
+
* "Start Symbol" = [s-Expression]
|
45
|
+
*
|
46
|
+
* {Atom Char} = {Printable} - {Whitespace} - [()"\'']
|
47
|
+
*
|
48
|
+
* Atom = ( {Atom Char} | '\'{Printable} )+
|
49
|
+
*
|
50
|
+
* [s-Expression] ::= [Quote] Atom
|
51
|
+
* | [Quote] '(' [Series] ')'
|
52
|
+
* | [Quote] '(' [s-Expression] '.' [s-Expression] ')'
|
53
|
+
*
|
54
|
+
* [Series] ::= [s-Expression] [Series]
|
55
|
+
* |
|
56
|
+
*
|
57
|
+
* [Quote] ::= '' !Quote = do not evaluate
|
58
|
+
* |
|
59
|
+
*
|
60
|
+
*
|
61
|
+
* I used <a href="http://gigamonkeys.com/book/">Practical Common Lisp</a> as
|
62
|
+
* the basis for the reserved word list.
|
63
|
+
*
|
64
|
+
*
|
65
|
+
* @author mikesamuel@gmail.com
|
66
|
+
*/
|
67
|
+
|
68
|
+
PR['registerLangHandler'](
|
69
|
+
PR['createSimpleLexer'](
|
70
|
+
[
|
71
|
+
['opn', /^\(+/, null, '('],
|
72
|
+
['clo', /^\)+/, null, ')'],
|
73
|
+
// A line comment that starts with ;
|
74
|
+
[PR['PR_COMMENT'], /^;[^\r\n]*/, null, ';'],
|
75
|
+
// Whitespace
|
76
|
+
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
77
|
+
// A double quoted, possibly multi-line, string.
|
78
|
+
[PR['PR_STRING'], /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"']
|
79
|
+
],
|
80
|
+
[
|
81
|
+
[PR['PR_KEYWORD'], /^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, null],
|
82
|
+
[PR['PR_LITERAL'],
|
83
|
+
/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],
|
84
|
+
// A single quote possibly followed by a word that optionally ends with
|
85
|
+
// = ! or ?.
|
86
|
+
[PR['PR_LITERAL'],
|
87
|
+
/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],
|
88
|
+
// A word that optionally ends with = ! or ?.
|
89
|
+
[PR['PR_PLAIN'],
|
90
|
+
/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],
|
91
|
+
// A printable non-space non-special character
|
92
|
+
[PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0()\"\\\';]+/]
|
93
|
+
]),
|
94
|
+
['cl', 'el', 'lisp', 'lsp', 'scm', 'ss', 'rkt']);
|
@@ -0,0 +1,61 @@
|
|
1
|
+
// Copyright (C) 2013 Nikhil Dabas
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @fileoverview
|
18
|
+
* Registers a language handler for LLVM.
|
19
|
+
* From https://gist.github.com/ndabas/2850418
|
20
|
+
*
|
21
|
+
*
|
22
|
+
* To use, include prettify.js and this file in your HTML page.
|
23
|
+
* Then put your code in an HTML tag like
|
24
|
+
* <pre class="prettyprint lang-llvm">(my LLVM code)</pre>
|
25
|
+
*
|
26
|
+
*
|
27
|
+
* The regular expressions were adapted from:
|
28
|
+
* https://github.com/hansstimer/llvm.tmbundle/blob/76fedd8f50fd6108b1780c51d79fbe3223de5f34/Syntaxes/LLVM.tmLanguage
|
29
|
+
*
|
30
|
+
* http://llvm.org/docs/LangRef.html#constants describes the language grammar.
|
31
|
+
*
|
32
|
+
* @author Nikhil Dabas
|
33
|
+
*/
|
34
|
+
PR['registerLangHandler'](
|
35
|
+
PR['createSimpleLexer'](
|
36
|
+
[
|
37
|
+
// Whitespace
|
38
|
+
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
39
|
+
// A double quoted, possibly multi-line, string.
|
40
|
+
[PR['PR_STRING'], /^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"'],
|
41
|
+
// comment.llvm
|
42
|
+
[PR['PR_COMMENT'], /^;[^\r\n]*/, null, ';']
|
43
|
+
],
|
44
|
+
[
|
45
|
+
// variable.llvm
|
46
|
+
[PR['PR_PLAIN'], /^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],
|
47
|
+
|
48
|
+
// According to http://llvm.org/docs/LangRef.html#well-formedness
|
49
|
+
// These reserved words cannot conflict with variable names, because none of them start with a prefix character ('%' or '@').
|
50
|
+
[PR['PR_KEYWORD'], /^[A-Za-z_][0-9A-Za-z_]*/, null],
|
51
|
+
|
52
|
+
// constant.numeric.float.llvm
|
53
|
+
[PR['PR_LITERAL'], /^\d+\.\d+/],
|
54
|
+
|
55
|
+
// constant.numeric.integer.llvm
|
56
|
+
[PR['PR_LITERAL'], /^(?:\d+|0[xX][a-fA-F0-9]+)/],
|
57
|
+
|
58
|
+
// punctuation
|
59
|
+
[PR['PR_PUNCTUATION'], /^[()\[\]{},=*<>:]|\.\.\.$/]
|
60
|
+
]),
|
61
|
+
['llvm', 'll']);
|
@@ -0,0 +1,59 @@
|
|
1
|
+
// Copyright (C) 2008 Google Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @fileoverview
|
19
|
+
* Registers a language handler for Lua.
|
20
|
+
*
|
21
|
+
*
|
22
|
+
* To use, include prettify.js and this file in your HTML page.
|
23
|
+
* Then put your code in an HTML tag like
|
24
|
+
* <pre class="prettyprint lang-lua">(my Lua code)</pre>
|
25
|
+
*
|
26
|
+
*
|
27
|
+
* I used http://www.lua.org/manual/5.1/manual.html#2.1
|
28
|
+
* Because of the long-bracket concept used in strings and comments, Lua does
|
29
|
+
* not have a regular lexical grammar, but luckily it fits within the space
|
30
|
+
* of irregular grammars supported by javascript regular expressions.
|
31
|
+
*
|
32
|
+
* @author mikesamuel@gmail.com
|
33
|
+
*/
|
34
|
+
|
35
|
+
PR['registerLangHandler'](
|
36
|
+
PR['createSimpleLexer'](
|
37
|
+
[
|
38
|
+
// Whitespace
|
39
|
+
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
40
|
+
// A double or single quoted, possibly multi-line, string.
|
41
|
+
[PR['PR_STRING'], /^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/, null, '"\'']
|
42
|
+
],
|
43
|
+
[
|
44
|
+
// A comment is either a line comment that starts with two dashes, or
|
45
|
+
// two dashes preceding a long bracketed block.
|
46
|
+
[PR['PR_COMMENT'], /^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],
|
47
|
+
// A long bracketed block not preceded by -- is a string.
|
48
|
+
[PR['PR_STRING'], /^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],
|
49
|
+
[PR['PR_KEYWORD'], /^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, null],
|
50
|
+
// A number is a hex integer literal, a decimal real literal, or in
|
51
|
+
// scientific notation.
|
52
|
+
[PR['PR_LITERAL'],
|
53
|
+
/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
|
54
|
+
// An identifier
|
55
|
+
[PR['PR_PLAIN'], /^[a-z_]\w*/i],
|
56
|
+
// A run of punctuation
|
57
|
+
[PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]
|
58
|
+
]),
|
59
|
+
['lua']);
|