drnic-codex 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. data/History.txt +4 -0
  2. data/LICENSE.txt +29 -0
  3. data/Manifest.txt +95 -0
  4. data/PostInstall.txt +5 -0
  5. data/README.txt +31 -0
  6. data/Rakefile +4 -0
  7. data/app_generators/codex/USAGE +5 -0
  8. data/app_generators/codex/codex_generator.rb +106 -0
  9. data/app_generators/codex/templates/Rakefile +54 -0
  10. data/app_generators/codex/templates/bin/build_all.rb +47 -0
  11. data/app_generators/codex/templates/bin/postprocess_all.rb +5 -0
  12. data/app_generators/codex/templates/bin/pressie.rb +8 -0
  13. data/app_generators/codex/templates/code/control/basic_continuation.rb +11 -0
  14. data/app_generators/codex/templates/code/control/cc_throw_catch.rb +59 -0
  15. data/app_generators/codex/templates/code/control/closure_continuation.rb +8 -0
  16. data/app_generators/codex/templates/code/control/closure_continuation_2.rb +12 -0
  17. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSS.html +115 -0
  18. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSharp.html +134 -0
  19. data/app_generators/codex/templates/dp.SyntaxHighlighter/CollapseCode.html +90 -0
  20. data/app_generators/codex/templates/dp.SyntaxHighlighter/Cpp.html +190 -0
  21. data/app_generators/codex/templates/dp.SyntaxHighlighter/CrashTest.html +108 -0
  22. data/app_generators/codex/templates/dp.SyntaxHighlighter/Delphi.html +112 -0
  23. data/app_generators/codex/templates/dp.SyntaxHighlighter/FirstLine.html +90 -0
  24. data/app_generators/codex/templates/dp.SyntaxHighlighter/Index.html +80 -0
  25. data/app_generators/codex/templates/dp.SyntaxHighlighter/Java.html +122 -0
  26. data/app_generators/codex/templates/dp.SyntaxHighlighter/JavaScript.html +112 -0
  27. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoControls.html +89 -0
  28. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoGutter.html +89 -0
  29. data/app_generators/codex/templates/dp.SyntaxHighlighter/PHP.html +102 -0
  30. data/app_generators/codex/templates/dp.SyntaxHighlighter/Python.html +121 -0
  31. data/app_generators/codex/templates/dp.SyntaxHighlighter/Ruby.html +131 -0
  32. data/app_generators/codex/templates/dp.SyntaxHighlighter/SQL.html +98 -0
  33. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/clipboard.swf +0 -0
  34. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCSharp.js +32 -0
  35. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCpp.js +73 -0
  36. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCss.js +52 -0
  37. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushDelphi.js +34 -0
  38. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJScript.js +22 -0
  39. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJava.js +28 -0
  40. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPhp.js +60 -0
  41. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPython.js +30 -0
  42. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushRuby.js +28 -0
  43. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushSql.js +42 -0
  44. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushVb.js +29 -0
  45. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushXml.js +70 -0
  46. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.js +414 -0
  47. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.uncompressed.js +674 -0
  48. data/app_generators/codex/templates/dp.SyntaxHighlighter/ShowColumns.html +89 -0
  49. data/app_generators/codex/templates/dp.SyntaxHighlighter/SmartTabs.html +88 -0
  50. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css +158 -0
  51. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/TestPages.css +63 -0
  52. data/app_generators/codex/templates/dp.SyntaxHighlighter/Templates/Test.dwt +80 -0
  53. data/app_generators/codex/templates/dp.SyntaxHighlighter/VB.html +115 -0
  54. data/app_generators/codex/templates/dp.SyntaxHighlighter/XML.html +136 -0
  55. data/app_generators/codex/templates/html/all.html +0 -0
  56. data/app_generators/codex/templates/readme.txt +4 -0
  57. data/app_generators/codex/templates/slides/basics.slides +37 -0
  58. data/app_generators/codex/templates/slides/building.slides +27 -0
  59. data/app_generators/codex/templates/slides/example.slides +80 -0
  60. data/app_generators/codex/templates/slides/including_code.slides +80 -0
  61. data/app_generators/codex/templates/slides/metadata.yml +4 -0
  62. data/app_generators/codex/templates/slides/table_of_contents.slides +14 -0
  63. data/app_generators/codex/templates/ui/default/blank.gif +0 -0
  64. data/app_generators/codex/templates/ui/default/bodybg.gif +0 -0
  65. data/app_generators/codex/templates/ui/default/framing.css +23 -0
  66. data/app_generators/codex/templates/ui/default/iepngfix.htc +42 -0
  67. data/app_generators/codex/templates/ui/default/opera.css +7 -0
  68. data/app_generators/codex/templates/ui/default/outline.css +15 -0
  69. data/app_generators/codex/templates/ui/default/pretty.css +86 -0
  70. data/app_generators/codex/templates/ui/default/print.css +1 -0
  71. data/app_generators/codex/templates/ui/default/s5-core.css +9 -0
  72. data/app_generators/codex/templates/ui/default/slides.css +3 -0
  73. data/app_generators/codex/templates/ui/default/slides.js +553 -0
  74. data/bin/codex +17 -0
  75. data/codex.gemspec +30 -0
  76. data/config/hoe.rb +74 -0
  77. data/config/requirements.rb +15 -0
  78. data/lib/codex/content.rb +160 -0
  79. data/lib/codex/pressie.rb +107 -0
  80. data/lib/codex/version.rb +9 -0
  81. data/lib/codex.rb +7 -0
  82. data/lib/stylesheets/pressie.css +196 -0
  83. data/lib/stylesheets/print.css +149 -0
  84. data/lib/stylesheets/ruby.png +0 -0
  85. data/script/console +10 -0
  86. data/script/destroy +14 -0
  87. data/script/generate +14 -0
  88. data/setup.rb +1585 -0
  89. data/tasks/deployment.rake +34 -0
  90. data/tasks/environment.rake +7 -0
  91. data/tasks/website.rake +9 -0
  92. data/test/test_codex.rb +11 -0
  93. data/test/test_codex_generator.rb +78 -0
  94. data/test/test_generator_helper.rb +29 -0
  95. data/test/test_helper.rb +2 -0
  96. metadata +163 -0
@@ -0,0 +1,22 @@
1
+ dp.sh.Brushes.JScript = function()
2
+ {
3
+ var keywords = 'abstract boolean break byte case catch char class const continue debugger ' +
4
+ 'default delete do double else enum export extends false final finally float ' +
5
+ 'for function goto if implements import in instanceof int interface long native ' +
6
+ 'new null package private protected public return short static super switch ' +
7
+ 'synchronized this throw throws transient true try typeof var void volatile while with';
8
+
9
+ this.regexList = [
10
+ { regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment' }, // one line comments
11
+ { regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment' }, // multiline comments
12
+ { regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // double quoted strings
13
+ { regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // single quoted strings
14
+ { regex: new RegExp('^\\s*#.*', 'gm'), css: 'preprocessor' }, // preprocessor tags like #region and #endregion
15
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keywords
16
+ ];
17
+
18
+ this.CssClass = 'dp-c';
19
+ }
20
+
21
+ dp.sh.Brushes.JScript.prototype = new dp.sh.Highlighter();
22
+ dp.sh.Brushes.JScript.Aliases = ['js', 'jscript', 'javascript'];
@@ -0,0 +1,28 @@
1
+ dp.sh.Brushes.Java = function()
2
+ {
3
+ var keywords = 'abstract assert boolean break byte case catch char class const ' +
4
+ 'continue default do double else enum extends ' +
5
+ 'false final finally float for goto if implements import ' +
6
+ 'instanceof int interface long native new null ' +
7
+ 'package private protected public return ' +
8
+ 'short static strictfp super switch synchronized this throw throws true ' +
9
+ 'transient try void volatile while';
10
+
11
+ this.regexList = [
12
+ { regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment' }, // one line comments
13
+ { regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment' }, // multiline comments
14
+ { regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // strings
15
+ { regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // strings
16
+ { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'number' }, // numbers
17
+ { regex: new RegExp('(?!\\@interface\\b)\\@[\\$\\w]+\\b', 'g'), css: 'annotation' }, // annotation @anno
18
+ { regex: new RegExp('\\@interface\\b', 'g'), css: 'keyword' }, // @interface keyword
19
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
20
+ ];
21
+
22
+ this.CssClass = 'dp-j';
23
+ this.Style = '.dp-j .annotation { color: #646464; }' +
24
+ '.dp-j .number { color: #C00000; }';
25
+ }
26
+
27
+ dp.sh.Brushes.Java.prototype = new dp.sh.Highlighter();
28
+ dp.sh.Brushes.Java.Aliases = ['java'];
@@ -0,0 +1,60 @@
1
+ dp.sh.Brushes.Php = function()
2
+ {
3
+ var funcs = 'abs acos acosh addcslashes addslashes ' +
4
+ 'array_change_key_case array_chunk array_combine array_count_values array_diff '+
5
+ 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
6
+ 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
7
+ 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
8
+ 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
9
+ 'array_push array_rand array_reduce array_reverse array_search array_shift '+
10
+ 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
11
+ 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
12
+ 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
13
+ 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
14
+ 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
15
+ 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
16
+ 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
17
+ 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
18
+ 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
19
+ 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
20
+ 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
21
+ 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
22
+ 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
23
+ 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
24
+ 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
25
+ 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
26
+ 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
27
+ 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
28
+ 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
29
+ 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
30
+ 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
31
+ 'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+
32
+ 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
33
+ 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
34
+ 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
35
+ 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
36
+ 'strtoupper strtr strval substr substr_compare';
37
+
38
+ var keywords = 'and or xor __FILE__ __LINE__ array as break case ' +
39
+ 'cfunction class const continue declare default die do else ' +
40
+ 'elseif empty enddeclare endfor endforeach endif endswitch endwhile ' +
41
+ 'extends for foreach function include include_once global if ' +
42
+ 'new old_function return static switch use require require_once ' +
43
+ 'var while __FUNCTION__ __CLASS__ ' +
44
+ '__METHOD__ abstract interface public implements extends private protected throw';
45
+
46
+ this.regexList = [
47
+ { regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment' }, // one line comments
48
+ { regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment' }, // multiline comments
49
+ { regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // double quoted strings
50
+ { regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // single quoted strings
51
+ { regex: new RegExp('\\$\\w+', 'g'), css: 'vars' }, // variables
52
+ { regex: new RegExp(this.GetKeywords(funcs), 'gmi'), css: 'func' }, // functions
53
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keyword
54
+ ];
55
+
56
+ this.CssClass = 'dp-c';
57
+ }
58
+
59
+ dp.sh.Brushes.Php.prototype = new dp.sh.Highlighter();
60
+ dp.sh.Brushes.Php.Aliases = ['php'];
@@ -0,0 +1,30 @@
1
+ /* Python 2.3 syntax contributed by Gheorghe Milas */
2
+ dp.sh.Brushes.Python = function()
3
+ {
4
+ var keywords = 'and assert break class continue def del elif else ' +
5
+ 'except exec finally for from global if import in is ' +
6
+ 'lambda not or pass print raise return try yield while';
7
+
8
+ var special = 'None True False self cls class_'
9
+
10
+ this.regexList = [
11
+ { regex: dp.sh.RegexLib.SingleLinePerlComments, css: 'comment' },
12
+ { regex: new RegExp("^\\s*@\\w+", 'gm'), css: 'decorator' },
13
+ { regex: new RegExp("(['\"]{3})([^\\1])*?\\1", 'gm'), css: 'comment' },
14
+ { regex: new RegExp('"(?!")(?:\\.|\\\\\\"|[^\\""\\n\\r])*"', 'gm'), css: 'string' },
15
+ { regex: new RegExp("'(?!')*(?:\\.|(\\\\\\')|[^\\''\\n\\r])*'", 'gm'), css: 'string' },
16
+ { regex: new RegExp("\\b\\d+\\.?\\w*", 'g'), css: 'number' },
17
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' },
18
+ { regex: new RegExp(this.GetKeywords(special), 'gm'), css: 'special' },
19
+ ];
20
+
21
+ this.CssClass = 'dp-py';
22
+ this.Style = '.dp-py .builtins { color: #ff1493; }' +
23
+ '.dp-py .magicmethods { color: #808080; }' +
24
+ '.dp-py .exceptions { color: brown; }' +
25
+ '.dp-py .types { color: brown; font-style: italic; }' +
26
+ '.dp-py .commonlibs { color: #8A2BE2; font-style: italic; }';
27
+ }
28
+
29
+ dp.sh.Brushes.Python.prototype = new dp.sh.Highlighter();
30
+ dp.sh.Brushes.Python.Aliases = ['py', 'python'];
@@ -0,0 +1,28 @@
1
+ /* Ruby 1.8.4 syntax contributed by Erik Peterson */
2
+ dp.sh.Brushes.Ruby = function()
3
+ {
4
+ var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
5
+ 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
6
+ 'self super then throw true undef unless until when while yield';
7
+
8
+ var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
9
+ 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
10
+ 'ThreadGroup Thread Time TrueClass'
11
+
12
+ this.regexList = [
13
+ { regex: dp.sh.RegexLib.SingleLinePerlComments, css: 'comment' }, // one line comments
14
+ { regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // double quoted strings
15
+ { regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // single quoted strings
16
+ { regex: new RegExp(':[a-z][A-Za-z0-9_]*', 'g'), css: 'symbol' }, // symbols
17
+ { regex: new RegExp('(\\$|@@|@)\\w+', 'g'), css: 'variable' }, // $global, @instance, and @@class variables
18
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
19
+ { regex: new RegExp(this.GetKeywords(builtins), 'gm'), css: 'builtin' } // builtins
20
+ ];
21
+
22
+ this.CssClass = 'dp-rb';
23
+ this.Style = '.dp-rb .symbol { color: #a70; }' +
24
+ '.dp-rb .variable { color: #a70; font-weight: bold; }';
25
+ }
26
+
27
+ dp.sh.Brushes.Ruby.prototype = new dp.sh.Highlighter();
28
+ dp.sh.Brushes.Ruby.Aliases = ['ruby', 'rails', 'ror'];
@@ -0,0 +1,42 @@
1
+ dp.sh.Brushes.Sql = function()
2
+ {
3
+ var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
4
+ 'current_user day isnull left lower month nullif replace right ' +
5
+ 'session_user space substring sum system_user upper user year';
6
+
7
+ var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
8
+ 'binary bit by cascade char character check checkpoint close collate ' +
9
+ 'column commit committed connect connection constraint contains continue ' +
10
+ 'create cube current current_date current_time cursor database date ' +
11
+ 'deallocate dec decimal declare default delete desc distinct double drop ' +
12
+ 'dynamic else end end-exec escape except exec execute false fetch first ' +
13
+ 'float for force foreign forward free from full function global goto grant ' +
14
+ 'group grouping having hour ignore index inner insensitive insert instead ' +
15
+ 'int integer intersect into is isolation key last level load local max min ' +
16
+ 'minute modify move name national nchar next no numeric of off on only ' +
17
+ 'open option order out output partial password precision prepare primary ' +
18
+ 'prior privileges procedure public read real references relative repeatable ' +
19
+ 'restrict return returns revoke rollback rollup rows rule schema scroll ' +
20
+ 'second section select sequence serializable set size smallint static ' +
21
+ 'statistics table temp temporary then time timestamp to top transaction ' +
22
+ 'translation trigger true truncate uncommitted union unique update values ' +
23
+ 'varchar varying view when where with work';
24
+
25
+ var operators = 'all and any between cross in join like not null or outer some';
26
+
27
+ this.regexList = [
28
+ { regex: new RegExp('--(.*)$', 'gm'), css: 'comment' }, // one line and multiline comments
29
+ { regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // double quoted strings
30
+ { regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // single quoted strings
31
+ { regex: new RegExp(this.GetKeywords(funcs), 'gmi'), css: 'func' }, // functions
32
+ { regex: new RegExp(this.GetKeywords(operators), 'gmi'), css: 'op' }, // operators and such
33
+ { regex: new RegExp(this.GetKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
34
+ ];
35
+
36
+ this.CssClass = 'dp-sql';
37
+ this.Style = '.dp-sql .func { color: #ff1493; }' +
38
+ '.dp-sql .op { color: #808080; }';
39
+ }
40
+
41
+ dp.sh.Brushes.Sql.prototype = new dp.sh.Highlighter();
42
+ dp.sh.Brushes.Sql.Aliases = ['sql'];
@@ -0,0 +1,29 @@
1
+ dp.sh.Brushes.Vb = function()
2
+ {
3
+ var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
4
+ 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
5
+ 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
6
+ 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
7
+ 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
8
+ 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
9
+ 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
10
+ 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
11
+ 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
12
+ 'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
13
+ 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
14
+ 'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
15
+ 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
16
+ 'Variant When While With WithEvents WriteOnly Xor';
17
+
18
+ this.regexList = [
19
+ { regex: new RegExp('\'.*$', 'gm'), css: 'comment' }, // one line comments
20
+ { regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // strings
21
+ { regex: new RegExp('^\\s*#.*', 'gm'), css: 'preprocessor' }, // preprocessor tags like #region and #endregion
22
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // c# keyword
23
+ ];
24
+
25
+ this.CssClass = 'dp-vb';
26
+ }
27
+
28
+ dp.sh.Brushes.Vb.prototype = new dp.sh.Highlighter();
29
+ dp.sh.Brushes.Vb.Aliases = ['vb', 'vb.net'];
@@ -0,0 +1,70 @@
1
+ dp.sh.Brushes.Xml = function()
2
+ {
3
+ this.CssClass = 'dp-xml';
4
+ this.Style = '.dp-xml .cdata { color: #ff1493; }' +
5
+ '.dp-xml .tag, .dp-xml .tag-name { color: #069; font-weight: bold; }' +
6
+ '.dp-xml .attribute { color: red; }' +
7
+ '.dp-xml .attribute-value { color: blue; }';
8
+ }
9
+
10
+ dp.sh.Brushes.Xml.prototype = new dp.sh.Highlighter();
11
+ dp.sh.Brushes.Xml.Aliases = ['xml', 'xhtml', 'xslt', 'html', 'xhtml'];
12
+
13
+ dp.sh.Brushes.Xml.prototype.ProcessRegexList = function()
14
+ {
15
+ function push(array, value)
16
+ {
17
+ array[array.length] = value;
18
+ }
19
+
20
+ /* If only there was a way to get index of a group within a match, the whole XML
21
+ could be matched with the expression looking something like that:
22
+
23
+ (<!\[CDATA\[\s*.*\s*\]\]>)
24
+ | (<!--\s*.*\s*?-->)
25
+ | (<)*(\w+)*\s*(\w+)\s*=\s*(".*?"|'.*?'|\w+)(/*>)*
26
+ | (</?)(.*?)(/?>)
27
+ */
28
+ var index = 0;
29
+ var match = null;
30
+ var regex = null;
31
+
32
+ // Match CDATA in the following format <![ ... [ ... ]]>
33
+ // (\&lt;|<)\!\[[\w\s]*?\[(.|\s)*?\]\](\&gt;|>)
34
+ this.GetMatches(new RegExp('(\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\&gt;|>)', 'gm'), 'cdata');
35
+
36
+ // Match comments
37
+ // (\&lt;|<)!--\s*.*\s*?--(\&gt;|>)
38
+ this.GetMatches(new RegExp('(\&lt;|<)!--\\s*.*\\s*?--(\&gt;|>)', 'gm'), 'comments');
39
+
40
+ // Match attributes and their values
41
+ // (:|\w+)\s*=\s*(".*?"|\'.*?\'|\w+)*
42
+ regex = new RegExp('([:\\w-\.]+)\\s*=\\s*(".*?"|\'.*?\'|\\w+)*|(\\w+)', 'gm'); // Thanks to Tomi Blinnikka of Yahoo! for fixing namespaces in attributes
43
+ while((match = regex.exec(this.code)) != null)
44
+ {
45
+ if(match[1] == null)
46
+ {
47
+ continue;
48
+ }
49
+
50
+ push(this.matches, new dp.sh.Match(match[1], match.index, 'attribute'));
51
+
52
+ // if xml is invalid and attribute has no property value, ignore it
53
+ if(match[2] != undefined)
54
+ {
55
+ push(this.matches, new dp.sh.Match(match[2], match.index + match[0].indexOf(match[2]), 'attribute-value'));
56
+ }
57
+ }
58
+
59
+ // Match opening and closing tag brackets
60
+ // (\&lt;|<)/*\?*(?!\!)|/*\?*(\&gt;|>)
61
+ this.GetMatches(new RegExp('(\&lt;|<)/*\\?*(?!\\!)|/*\\?*(\&gt;|>)', 'gm'), 'tag');
62
+
63
+ // Match tag names
64
+ // (\&lt;|<)/*\?*\s*(\w+)
65
+ regex = new RegExp('(?:\&lt;|<)/*\\?*\\s*([:\\w-\.]+)', 'gm');
66
+ while((match = regex.exec(this.code)) != null)
67
+ {
68
+ push(this.matches, new dp.sh.Match(match[1], match.index + match[0].indexOf(match[1]), 'tag-name'));
69
+ }
70
+ }