showoffer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +559 -0
  3. data/Rakefile +27 -0
  4. data/bin/showoffer +189 -0
  5. data/lib/commandline_parser.rb +67 -0
  6. data/lib/showoff.rb +515 -0
  7. data/lib/showoff/version.rb +3 -0
  8. data/lib/showoff_utils.rb +360 -0
  9. data/public/css/960.css +653 -0
  10. data/public/css/fg.menu.css +114 -0
  11. data/public/css/onepage.css +60 -0
  12. data/public/css/pdf.css +12 -0
  13. data/public/css/presenter.css +76 -0
  14. data/public/css/reset.css +53 -0
  15. data/public/css/sh_style.css +66 -0
  16. data/public/css/showoff.css +403 -0
  17. data/public/css/spinner_bar.gif +0 -0
  18. data/public/css/theme/images/ui-bg_diagonals-small_100_f0efea_40x40.png +0 -0
  19. data/public/css/theme/images/ui-bg_flat_35_f0f0f0_40x100.png +0 -0
  20. data/public/css/theme/images/ui-bg_glass_55_fcf0ba_1x400.png +0 -0
  21. data/public/css/theme/images/ui-bg_glow-ball_25_2e2e28_600x600.png +0 -0
  22. data/public/css/theme/images/ui-bg_highlight-soft_100_f0efea_1x100.png +0 -0
  23. data/public/css/theme/images/ui-bg_highlight-soft_25_327E04_1x100.png +0 -0
  24. data/public/css/theme/images/ui-bg_highlight-soft_25_5A9D1A_1x100.png +0 -0
  25. data/public/css/theme/images/ui-bg_highlight-soft_95_ffedad_1x100.png +0 -0
  26. data/public/css/theme/images/ui-bg_inset-soft_22_3b3b35_1x100.png +0 -0
  27. data/public/css/theme/images/ui-icons_808080_256x240.png +0 -0
  28. data/public/css/theme/images/ui-icons_8DC262_256x240.png +0 -0
  29. data/public/css/theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  30. data/public/css/theme/images/ui-icons_e7e6e4_256x240.png +0 -0
  31. data/public/css/theme/images/ui-icons_eeeeee_256x240.png +0 -0
  32. data/public/css/theme/images/ui-icons_ffffff_256x240.png +0 -0
  33. data/public/css/theme/ui.accordion.css +9 -0
  34. data/public/css/theme/ui.all.css +2 -0
  35. data/public/css/theme/ui.base.css +9 -0
  36. data/public/css/theme/ui.core.css +37 -0
  37. data/public/css/theme/ui.datepicker.css +62 -0
  38. data/public/css/theme/ui.dialog.css +13 -0
  39. data/public/css/theme/ui.progressbar.css +4 -0
  40. data/public/css/theme/ui.resizable.css +13 -0
  41. data/public/css/theme/ui.slider.css +17 -0
  42. data/public/css/theme/ui.tabs.css +9 -0
  43. data/public/css/theme/ui.theme.css +245 -0
  44. data/public/favicon.ico +0 -0
  45. data/public/highlight/AUTHORS.en.txt +46 -0
  46. data/public/highlight/AUTHORS.ru.txt +46 -0
  47. data/public/highlight/LICENSE +24 -0
  48. data/public/highlight/README.md +136 -0
  49. data/public/highlight/README.ru.md +140 -0
  50. data/public/highlight/classref.txt +437 -0
  51. data/public/highlight/export.html +87 -0
  52. data/public/highlight/highlight.js +630 -0
  53. data/public/highlight/highlight.pack.js +1 -0
  54. data/public/highlight/languages/1c.js +68 -0
  55. data/public/highlight/languages/apache.js +432 -0
  56. data/public/highlight/languages/avrasm.js +75 -0
  57. data/public/highlight/languages/axapta.js +43 -0
  58. data/public/highlight/languages/bash.js +56 -0
  59. data/public/highlight/languages/cmake.js +24 -0
  60. data/public/highlight/languages/cpp.js +62 -0
  61. data/public/highlight/languages/cs.js +41 -0
  62. data/public/highlight/languages/css.js +101 -0
  63. data/public/highlight/languages/delphi.js +70 -0
  64. data/public/highlight/languages/diff.js +64 -0
  65. data/public/highlight/languages/django.js +72 -0
  66. data/public/highlight/languages/dos.js +29 -0
  67. data/public/highlight/languages/erlang-repl.js +81 -0
  68. data/public/highlight/languages/erlang.js +201 -0
  69. data/public/highlight/languages/go.js +58 -0
  70. data/public/highlight/languages/haskell.js +77 -0
  71. data/public/highlight/languages/ini.js +32 -0
  72. data/public/highlight/languages/java.js +45 -0
  73. data/public/highlight/languages/javascript.js +53 -0
  74. data/public/highlight/languages/lisp.js +87 -0
  75. data/public/highlight/languages/lua.js +75 -0
  76. data/public/highlight/languages/mel.js +40 -0
  77. data/public/highlight/languages/nginx.js +224 -0
  78. data/public/highlight/languages/objectivec.js +94 -0
  79. data/public/highlight/languages/parser3.js +52 -0
  80. data/public/highlight/languages/perl.js +143 -0
  81. data/public/highlight/languages/php.js +55 -0
  82. data/public/highlight/languages/profile.js +49 -0
  83. data/public/highlight/languages/python.js +71 -0
  84. data/public/highlight/languages/renderman.js +230 -0
  85. data/public/highlight/languages/ruby.js +203 -0
  86. data/public/highlight/languages/scala.js +60 -0
  87. data/public/highlight/languages/smalltalk.js +55 -0
  88. data/public/highlight/languages/sql.js +90 -0
  89. data/public/highlight/languages/tex.js +62 -0
  90. data/public/highlight/languages/vala.js +75 -0
  91. data/public/highlight/languages/vbscript.js +30 -0
  92. data/public/highlight/languages/vhdl.js +30 -0
  93. data/public/highlight/languages/xml.js +103 -0
  94. data/public/highlight/styles/arta.css +151 -0
  95. data/public/highlight/styles/ascetic.css +45 -0
  96. data/public/highlight/styles/brown_paper.css +105 -0
  97. data/public/highlight/styles/brown_papersq.png +0 -0
  98. data/public/highlight/styles/dark.css +103 -0
  99. data/public/highlight/styles/default.css +121 -0
  100. data/public/highlight/styles/far.css +118 -0
  101. data/public/highlight/styles/github.css +129 -0
  102. data/public/highlight/styles/idea.css +118 -0
  103. data/public/highlight/styles/ir_black.css +103 -0
  104. data/public/highlight/styles/magula.css +118 -0
  105. data/public/highlight/styles/school_book.css +111 -0
  106. data/public/highlight/styles/school_book.png +0 -0
  107. data/public/highlight/styles/solarized_dark.css +96 -0
  108. data/public/highlight/styles/solarized_light.css +96 -0
  109. data/public/highlight/styles/sunburst.css +147 -0
  110. data/public/highlight/styles/vs.css +84 -0
  111. data/public/highlight/styles/zenburn.css +115 -0
  112. data/public/highlight/test.html +1609 -0
  113. data/public/js/coffee-script.js +8 -0
  114. data/public/js/core.js +79 -0
  115. data/public/js/fg.menu.js +645 -0
  116. data/public/js/jTypeWriter.js +26 -0
  117. data/public/js/jquery-1.4.2.min.js +154 -0
  118. data/public/js/jquery-print.js +109 -0
  119. data/public/js/jquery.batchImageLoad.js +56 -0
  120. data/public/js/jquery.cookie.js +96 -0
  121. data/public/js/jquery.cycle.all.js +1284 -0
  122. data/public/js/jquery.doubletap-0.1.js +105 -0
  123. data/public/js/jquery.uuid.js +24 -0
  124. data/public/js/jquery.ws-0.3pre.js +201 -0
  125. data/public/js/onepage.js +5 -0
  126. data/public/js/presenter.js +193 -0
  127. data/public/js/sh_lang/sh_bison.min.js +1 -0
  128. data/public/js/sh_lang/sh_c.min.js +1 -0
  129. data/public/js/sh_lang/sh_caml.min.js +1 -0
  130. data/public/js/sh_lang/sh_changelog.min.js +1 -0
  131. data/public/js/sh_lang/sh_coffeescript.min.js +1 -0
  132. data/public/js/sh_lang/sh_cpp.min.js +1 -0
  133. data/public/js/sh_lang/sh_csharp.min.js +1 -0
  134. data/public/js/sh_lang/sh_css.min.js +1 -0
  135. data/public/js/sh_lang/sh_cucumber.min.js +2 -0
  136. data/public/js/sh_lang/sh_desktop.min.js +1 -0
  137. data/public/js/sh_lang/sh_diff.min.js +1 -0
  138. data/public/js/sh_lang/sh_erlang.min.js +1 -0
  139. data/public/js/sh_lang/sh_flex.min.js +1 -0
  140. data/public/js/sh_lang/sh_glsl.min.js +1 -0
  141. data/public/js/sh_lang/sh_haxe.min.js +1 -0
  142. data/public/js/sh_lang/sh_html.min.js +1 -0
  143. data/public/js/sh_lang/sh_java.min.js +1 -0
  144. data/public/js/sh_lang/sh_javascript.min.js +1 -0
  145. data/public/js/sh_lang/sh_javascript_dom.min.js +1 -0
  146. data/public/js/sh_lang/sh_latex.min.js +1 -0
  147. data/public/js/sh_lang/sh_ldap.min.js +1 -0
  148. data/public/js/sh_lang/sh_log.min.js +1 -0
  149. data/public/js/sh_lang/sh_lsm.min.js +1 -0
  150. data/public/js/sh_lang/sh_m4.min.js +1 -0
  151. data/public/js/sh_lang/sh_makefile.min.js +1 -0
  152. data/public/js/sh_lang/sh_oracle.min.js +1 -0
  153. data/public/js/sh_lang/sh_pascal.min.js +1 -0
  154. data/public/js/sh_lang/sh_perl.min.js +1 -0
  155. data/public/js/sh_lang/sh_php.min.js +1 -0
  156. data/public/js/sh_lang/sh_prolog.min.js +1 -0
  157. data/public/js/sh_lang/sh_properties.min.js +1 -0
  158. data/public/js/sh_lang/sh_python.min.js +1 -0
  159. data/public/js/sh_lang/sh_ruby.min.js +1 -0
  160. data/public/js/sh_lang/sh_scala.min.js +1 -0
  161. data/public/js/sh_lang/sh_sh.min.js +1 -0
  162. data/public/js/sh_lang/sh_slang.min.js +1 -0
  163. data/public/js/sh_lang/sh_sml.min.js +1 -0
  164. data/public/js/sh_lang/sh_spec.min.js +1 -0
  165. data/public/js/sh_lang/sh_sql.min.js +1 -0
  166. data/public/js/sh_lang/sh_tcl.min.js +1 -0
  167. data/public/js/sh_lang/sh_xml.min.js +1 -0
  168. data/public/js/sh_lang/sh_xorg.min.js +1 -0
  169. data/public/js/sh_main.min.js +4 -0
  170. data/public/js/showoff.js +652 -0
  171. data/public/js/showoffcore.js +13 -0
  172. data/public/scripts/script.js +280 -0
  173. data/public/themes/ribbon/fonts/DroidSansMono.svg +626 -0
  174. data/public/themes/ribbon/fonts/DroidSansMono.ttf +0 -0
  175. data/public/themes/ribbon/fonts/PTSans.Bold.Italic.svg +728 -0
  176. data/public/themes/ribbon/fonts/PTSans.Bold.Italic.ttf +0 -0
  177. data/public/themes/ribbon/fonts/PTSans.Bold.Italic.woff +0 -0
  178. data/public/themes/ribbon/fonts/PTSans.Bold.svg +728 -0
  179. data/public/themes/ribbon/fonts/PTSans.Bold.ttf +0 -0
  180. data/public/themes/ribbon/fonts/PTSans.Bold.woff +0 -0
  181. data/public/themes/ribbon/fonts/PTSans.Italic.svg +728 -0
  182. data/public/themes/ribbon/fonts/PTSans.Italic.ttf +0 -0
  183. data/public/themes/ribbon/fonts/PTSans.Italic.woff +0 -0
  184. data/public/themes/ribbon/fonts/PTSans.Narrow.Bold.svg +728 -0
  185. data/public/themes/ribbon/fonts/PTSans.Narrow.Bold.ttf +0 -0
  186. data/public/themes/ribbon/fonts/PTSans.Narrow.Bold.woff +0 -0
  187. data/public/themes/ribbon/fonts/PTSans.Narrow.svg +728 -0
  188. data/public/themes/ribbon/fonts/PTSans.Narrow.ttf +0 -0
  189. data/public/themes/ribbon/fonts/PTSans.Narrow.woff +0 -0
  190. data/public/themes/ribbon/fonts/PTSans.svg +728 -0
  191. data/public/themes/ribbon/fonts/PTSans.ttf +0 -0
  192. data/public/themes/ribbon/fonts/PTSans.woff +0 -0
  193. data/public/themes/ribbon/fonts/TargetBlank.otf +0 -0
  194. data/public/themes/ribbon/fonts/TargetBlank.svg +14 -0
  195. data/public/themes/ribbon/images/grid.png +0 -0
  196. data/public/themes/ribbon/images/linen.png +0 -0
  197. data/public/themes/ribbon/images/ribbon.svg +4 -0
  198. data/public/themes/ribbon/styles/fonts.css +63 -0
  199. data/public/themes/ribbon/styles/print.css +68 -0
  200. data/public/themes/ribbon/styles/reset.css +42 -0
  201. data/public/themes/ribbon/styles/style.css +408 -0
  202. data/views/header.erb +11 -0
  203. data/views/index.erb +13 -0
  204. data/views/onepage.erb +39 -0
  205. data/views/presenter.erb +70 -0
  206. metadata +328 -0
Binary file
@@ -0,0 +1,46 @@
1
+ Syntax highlighting with language autodetection.
2
+
3
+ URL: http://softwaremaniacs.org/soft/highlight/en/
4
+
5
+ Original author and current maintainer:
6
+ Ivan Sagalaev <maniac@softwaremaniacs.org>
7
+
8
+ Contributors:
9
+
10
+ - Peter Leonov <gojpeg@gmail.com>
11
+ - Victor Karamzin <Victor.Karamzin@enterra-inc.com>
12
+ - Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
13
+ - Anton Kovalyov <anton@kovalyov.net>
14
+ - Nikita Ledyaev <lenikita@yandex.ru>
15
+ - Konstantin Evdokimenko <qewerty@gmail.com>
16
+ - Dmitri Roudakov <dmitri@roudakov.ru>
17
+ - Yuri Ivanov <ivanov@supersoft.ru>
18
+ - Vladimir Ermakov <vooon341@mail.ru>
19
+ - Vladimir Gubarkov <xonixx@gmail.com>
20
+ - Brian Beck <exogen@gmail.com>
21
+ - MajestiC <majestic2k@gmail.com>
22
+ - Vasily Polovnyov <vast@whiteants.net>
23
+ - Vladimir Epifanov <voldmar@voldmar.ru>
24
+ - Alexander Makarov (http://rmcreative.ru/)
25
+ - Vah <vahtenberg@gmail.com>
26
+ - Shuen-Huei Guan <drake.guan@gmail.com>
27
+ - Jason Diamond <jason@diamond.name>
28
+ - Michal Gabrukiewicz <mgabru@gmail.com>
29
+ - Ruslan Keba <rukeba@gmail.com>
30
+ - Sergey Baranov <segyrn@yandex.ru>
31
+ - Zaripov Yura <yur4ik7@ukr.net>
32
+ - Oleg Volchkov <oleg@volchkov.net>
33
+ - Vasily Mikhailitchenko <vaskas@programica.ru>
34
+ - Jan Berkel <jan.berkel@gmail.com>
35
+ - Vladimir Moskva <vladmos@gmail.com>
36
+ - Loren Segal <lsegal@soen.ca>
37
+ - Andrew Fedorov <dmmdrs@mail.ru>
38
+ - Igor Kalnitsky <igor.kalnitsky@gmail.com>
39
+ - Jeremy Hull <sourdrums@gmail.com>
40
+ - Valerii Hiora <valerii.hiora@gmail.com>
41
+ - Nikolay Zakharov <nikolay.desh@gmail.com>
42
+ - Dmitry Kovega <arhibot@gmail.com>
43
+ - Sergey Ignatov <sergey@ignatov.spb.su>
44
+ - Antono Vasiljev <self@antono.info>
45
+ - Stephan Kountso <steplg@gmail.com>
46
+ - pumbur <pumbur@pumbur.net>
@@ -0,0 +1,46 @@
1
+ Подсветка синтаксиса с автоопределением языка.
2
+
3
+ URL: http://softwaremaniacs.org/soft/highlight/
4
+
5
+ Первоначальный автор и ведущий проекта:
6
+ Иван Сагалаев <maniac@softwaremaniacs.org>
7
+
8
+ Внесли свой вклад:
9
+
10
+ - Петр Леонов <gojpeg@gmail.com>
11
+ - Виктор Карамзин <Victor.Karamzin@enterra-inc.com>
12
+ - Всеволод Соловьёв <vsevolod.solovyov@gmail.com>
13
+ - Антон Ковалёв <anton@kovalyov.net>
14
+ - Никита Ледяев <lenikita@yandex.ru>
15
+ - Константин Евдокименко <qewerty@gmail.com>
16
+ - Дмитрий Рудаков <dmitri@roudakov.ru>
17
+ - Юрий Иванов <ivanov@supersoft.ru>
18
+ - Владимир Ермаков <vooon341@mail.ru>
19
+ - Владимир Губарьков <xonixx@gmail.com>
20
+ - Брайан Бек <exogen@gmail.com>
21
+ - MajestiC <majestic2k@gmail.com>
22
+ - Василий Половнёв <vast@whiteants.net>
23
+ - Владимир Епифанов <voldmar@voldmar.ru>
24
+ - Александр Макаров (http://rmcreative.ru/)
25
+ - Vah <vahtenberg@gmail.com>
26
+ - Шуэн-Хуэй Гуан <drake.guan@gmail.com>
27
+ - Джейсон Даймонд <jason@diamond.name>
28
+ - Михал Габрукевич <mgabru@gmail.com>
29
+ - Руслан Кеба <rukeba@gmail.com>
30
+ - Сергей Баранов <segyrn@yandex.ru>
31
+ - Зарипов Юра <yur4ik7@ukr.net>
32
+ - Олег Волчков <oleg@volchkov.net>
33
+ - Василий Михайличенко <vaskas@programica.ru>
34
+ - Ян Беркель <jan.berkel@gmail.com>
35
+ - Владимир Москва <vladmos@gmail.com>
36
+ - Лорен Сегал <lsegal@soen.ca>
37
+ - Андрей Фёдоров <dmmdrs@mail.ru>
38
+ - Игорь Кальницкий <igor.kalnitsky@gmail.com>
39
+ - Джереми Халл <sourdrums@gmail.com>
40
+ - Валерий Хиора <valerii.hiora@gmail.com>
41
+ - Николай Захаров <nikolay.desh@gmail.com>
42
+ - Дмитрий Ковега <arhibot@gmail.com>
43
+ - Сергей Игнатов <sergey@ignatov.spb.su>
44
+ - Антоно Васильев <self@antono.info>
45
+ - Степан Кунцьо <steplg@gmail.com>
46
+ - pumbur <pumbur@pumbur.net>
@@ -0,0 +1,24 @@
1
+ Copyright (c) 2006, Ivan Sagalaev
2
+ All rights reserved.
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+ * Neither the name of highlight.js nor the names of its contributors
12
+ may be used to endorse or promote products derived from this software
13
+ without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
16
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,136 @@
1
+ # Highlight.js
2
+
3
+ Highlight.js highlights syntax in code examples on blogs, forums and,
4
+ in fact, on any web page. It's very easy to use because it works
5
+ automatically: finds blocks of code, detects a language, highlights it.
6
+
7
+ Autodetection can be fine tuned when it fails by itself (see "Heuristics").
8
+
9
+
10
+ ## Installation and usage
11
+
12
+ The download package includes the file "highlight.pack.js" which is a full
13
+ compressed version of the library intended for use in production. All
14
+ uncompressed source files are also available, feel free to look into them!
15
+
16
+ The script is installed by linking to a single file and making a single
17
+ initialization call:
18
+
19
+ ```html
20
+ <script type="text/javascript" src="highlight.pack.js"></script>
21
+ <script type="text/javascript">
22
+ hljs.initHighlightingOnLoad();
23
+ </script>
24
+ ```
25
+
26
+ Also you can replace TAB ('\x09') characters used for indentation in your code
27
+ with some fixed number of spaces or with a `<span>` to give them special
28
+ styling:
29
+
30
+ ```html
31
+ <script type="text/javascript">
32
+ hljs.tabReplace = ' '; // 4 spaces
33
+ // ... or
34
+ hljs.tabReplace = '<span class="indent">\t</span>';
35
+
36
+ hljs.initHighlightingOnLoad();
37
+ </script>
38
+ ```
39
+
40
+ The script looks in your page for fragments `<pre><code>...</code></pre>`
41
+ that are traditionally used to mark up code examples. Their content is
42
+ marked up by logical pieces with defined class names.
43
+
44
+
45
+ ### Custom initialization
46
+
47
+ If you use different markup for code blocks you can initialize them manually
48
+ with `highlightBlock(code, tabReplace)` function. It takes a DOM element
49
+ containing the code to highlight and optionally a string with which to replace
50
+ TAB characters.
51
+
52
+ Initialization using, for example, jQuery might look like this:
53
+
54
+ ```javascript
55
+ $(document).ready(function() {
56
+ $('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')});
57
+ });
58
+ ```
59
+
60
+ If your code container relies on `<br>` tags instead of line breaks (i.e. if
61
+ it's not `<pre>`) pass `true` into third parameter of `highlightBlock`:
62
+
63
+ ```javascript
64
+ $('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)});
65
+ ```
66
+
67
+ ### Styling
68
+
69
+ Elements of code marked up with classes can be styled as desired:
70
+
71
+ ```css
72
+ .comment {
73
+ color: gray;
74
+ }
75
+
76
+ .keyword {
77
+ font-weight: bold;
78
+ }
79
+
80
+ .python .string {
81
+ color: blue;
82
+ }
83
+
84
+ .html .atribute .value {
85
+ color: green;
86
+ }
87
+ ```
88
+
89
+ Highlight.js comes with several style themes located in "styles" directory that
90
+ can be used directly or as a base for your own experiments.
91
+
92
+ For full reference list of classes see [classref.txt][cr].
93
+
94
+ [cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt
95
+
96
+
97
+ ## Export
98
+
99
+ File export.html contains a little program that allows you to paste in a code
100
+ snippet and then copy and paste the resulting HTML code generated by the
101
+ highlighter. This is useful in situations when you can't use the script itself
102
+ on a site.
103
+
104
+
105
+ ## Heuristics
106
+
107
+ Autodetection of a code's language is done using a simple heuristic:
108
+ the program tries to highlight a fragment with all available languages and
109
+ counts all syntactic structures that it finds along the way. The language
110
+ with greatest count wins.
111
+
112
+ This means that in short fragments the probability of an error is high
113
+ (and it really happens sometimes). In this cases you can set the fragment's
114
+ language explicitly by assigning a class to the `<code>` element:
115
+
116
+ ```html
117
+ <pre><code class="html">...</code></pre>
118
+ ```
119
+
120
+ You can use class names recommended in HTML5: "language-html",
121
+ "language-php". Classes also can be assigned to the `<pre>` element.
122
+
123
+ To disable highlighting of a fragment altogether use "no-highlight" class:
124
+
125
+ ```html
126
+ <pre><code class="no-highlight">...</code></pre>
127
+ ```
128
+
129
+ ## Meta
130
+
131
+ - Version: 6.1
132
+ - URL: http://softwaremaniacs.org/soft/highlight/en/
133
+ - Author: Ivan Sagalaev (<maniac@softwaremaniacs.org>)
134
+
135
+ For the license terms see LICENSE files.
136
+ For the list of contributors see AUTHORS.en.txt file.
@@ -0,0 +1,140 @@
1
+ # Highlight.js
2
+
3
+ Highlight.js нужен для подсветки синтаксиса в примерах кода в блогах,
4
+ форумах и вообще на любых веб-страницах. Пользоваться им очень просто,
5
+ потому что работает он автоматически: сам находит блоки кода, сам
6
+ определяет язык, сам подсвечивает.
7
+
8
+ Автоопределением языка можно управлять, когда оно не справляется само (см.
9
+ дальше "Эвристика").
10
+
11
+
12
+ ## Подключение и использование
13
+
14
+ В загруженном архиве лежит файл "highlight.pack.js" -- полная сжатая версия
15
+ библиотеки для работы. Все несжатые исходные файлы также есть в пакете, поэтому
16
+ не стесняйтесь в них смотреть!
17
+
18
+ Скрипт подключается одним файлом и одним вызовом инициализирующей
19
+ функции:
20
+
21
+ ```html
22
+ <script type="text/javascript" src="highlight.pack.js"></script>
23
+ <script type="text/javascript">
24
+ hljs.initHighlightingOnLoad();
25
+ </script>
26
+ ```
27
+
28
+ Также вы можете заменить символы TAB ('\x09'), используемые для отступов, на
29
+ фиксированное количество пробелов или на отдельный `<span>`, чтобы задать ему
30
+ какой-нибудь специальный стиль:
31
+
32
+ ```html
33
+ <script type="text/javascript">
34
+ hljs.tabReplace = ' '; // 4 spaces
35
+ // ... or
36
+ hljs.tabReplace = '<span class="indent">\t</span>';
37
+
38
+ hljs.initHighlightingOnLoad();
39
+ </script>
40
+ ```
41
+
42
+ Дальше скрипт ищет на странице конструкции `<pre><code>...</code></pre>`,
43
+ которые традиционно используются для написания кода, и код в них
44
+ размечается на куски, помеченные разными значениями классов.
45
+
46
+
47
+ ### Инициализация вручную
48
+
49
+ Если вы используете другие теги для блоков кода, вы можете инициализировать их
50
+ явно с помощью функции `highlightBlock(code, tabReplace)`. Она принимает
51
+ DOM-элемент с текстом расцвечиваемого кода и опционально - строчку для замены
52
+ символов TAB.
53
+
54
+ Например с использованием jQuery код инициализации может выглядеть так:
55
+
56
+ ```javascript
57
+ $(document).ready(function() {
58
+ $('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')});
59
+ });
60
+ ```
61
+
62
+ Если ваш блок кода использует `<br>` вместо переводов строки (т.е. если это не
63
+ `<pre>`), передайте `true` третьим параметром в `highlightBlock`:
64
+
65
+ ```javascript
66
+ $('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)});
67
+ ```
68
+
69
+ ### Выбор стилей
70
+
71
+ Размеченным классами элементам кода можно задать желаемые стили например так:
72
+
73
+ ```css
74
+ .comment {
75
+ color: gray;
76
+ }
77
+
78
+ .keyword {
79
+ font-weight: bold;
80
+ }
81
+
82
+ .python .string {
83
+ color: blue;
84
+ }
85
+
86
+ .html .atribute .value {
87
+ color: green;
88
+ }
89
+ ```
90
+
91
+ В комплекте с highlight.js идут несколько стилевых тем в директории styles,
92
+ которые можно использовать напрямую или как основу для собственных экспериментов.
93
+
94
+ Полный список классов приведён в файле [crossref.txt][cr].
95
+
96
+ [cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt
97
+
98
+
99
+ ## Экспорт
100
+
101
+ В файле export.html находится небольшая программка, которая показывает и дает
102
+ скопировать непосредственно HTML-код подсветки для любого заданного фрагмента кода.
103
+ Это может понадобится например на сайте, на котором нельзя подключить сам скрипт
104
+ highlight.js.
105
+
106
+
107
+ ## Эвристика
108
+
109
+ Определение языка, на котором написан фрагмент, делается с помощью
110
+ довольно простой эвристики: программа пытается расцветить фрагмент всеми
111
+ языками подряд, и для каждого языка считает количество подошедших
112
+ синтаксически конструкций и ключевых слов. Для какого языка нашлось больше,
113
+ тот и выбирается.
114
+
115
+ Это означает, что в коротких фрагментах высока вероятность ошибки, что
116
+ периодически и случается. Чтобы указать язык фрагмента явно, надо написать
117
+ его название в виде класса к элементу `<code>`:
118
+
119
+ ```html
120
+ <pre><code class="html">...</code></pre>
121
+ ```
122
+
123
+ Можно использовать рекомендованные в HTML5 названия классов:
124
+ "language-html", "language-php". Также можно назначать классы на элемент
125
+ `<pre>`.
126
+
127
+ Чтобы запретить расцветку фрагмента вообще, используется класс "no-highlight":
128
+
129
+ ```html
130
+ <pre><code class="no-highlight">...</code></pre>
131
+ ```
132
+
133
+ ## Координаты
134
+
135
+ - Версия: 6.1
136
+ - URL: http://softwaremaniacs.org/soft/highlight/
137
+ - Автор: Иван Сагалаев (<maniac@softwaremaniacs.org>)
138
+
139
+ Лицензионное соглашение читайте в файле LICENSE.
140
+ Список соавторов читайте в файле AUTHORS.ru.txt
@@ -0,0 +1,437 @@
1
+ This is a full list of available classes corresponding to languages'
2
+ syntactic structures. The parentheses after language name contain identifiers
3
+ used as class names in `<code>` element.
4
+
5
+ Python ("python"):
6
+
7
+ keyword keyword
8
+ built_in built-in objects (None, False, True and Ellipsis)
9
+ number number
10
+ string string (of any type)
11
+ comment comment
12
+ decorator @-decorator for functions
13
+ function function header "def some_name(...):"
14
+ class class header "class SomeName(...):"
15
+ title name of a function or a class inside a header
16
+ params everything inside parentheses in a function's or class' header
17
+
18
+ Python profiler results ("profile"):
19
+
20
+ number number
21
+ string string
22
+ builtin builtin function entry
23
+ filename filename in an entry
24
+ summary profiling summary
25
+ header header of table of results
26
+ keyword column header
27
+ function function name in an entry (including parentheses)
28
+ title actual name of a function in an entry (excluding parentheses)
29
+
30
+ Ruby ("ruby"):
31
+
32
+ keyword keyword
33
+ string string
34
+ subst in-string substitution (#{...})
35
+ comment comment
36
+ yardoctag YARD tag
37
+ function function header "def some_name(...):"
38
+ class class header "class SomeName(...):"
39
+ title name of a function or a class inside a header
40
+ parent name of a parent class
41
+ symbol symbol
42
+ instancevar instance variable
43
+
44
+ Perl ("perl"):
45
+
46
+ keyword keyword
47
+ comment comment
48
+ number number
49
+ string string
50
+ regexp regular expression
51
+ sub subroutine header (from "sub" till "{")
52
+ variable variable starting with "$", "%", "@"
53
+ operator operator
54
+ pod plain old doc
55
+
56
+ PHP ("php"):
57
+
58
+ keyword keyword
59
+ number number
60
+ string string (of any type)
61
+ comment comment
62
+ phpdoc phpdoc params in comments
63
+ variable variable starting with "$"
64
+ preprocessor preprocessor marks: "<?php" and "?>"
65
+
66
+ Scala ("scala"):
67
+
68
+ keyword keyword
69
+ number number
70
+ string string
71
+ comment comment
72
+ annotaion annotation
73
+ javadoc javadoc comment
74
+ javadoctag @-tag in javadoc
75
+ class class header
76
+ title class name inside a header
77
+ params everything in parentheses inside a class header
78
+ inheritance keywords "extends" and "with" inside class header
79
+
80
+ Go language ("go"):
81
+ comment comment
82
+ string string constant
83
+ number number
84
+ keyword language keywords
85
+ constant true false nil iota
86
+ typename built-in plain types (int, string etc.)
87
+ built_in built-in functions
88
+
89
+ XML ("xml"):
90
+
91
+ tag any tag from "<" till ">"
92
+ comment comment
93
+ pi processing instruction (<? ... ?>)
94
+ cdata CDATA section
95
+ attribute attribute
96
+ value attribute's value
97
+
98
+ HTML ("html"):
99
+
100
+ keyword HTML tag
101
+ tag any tag from "<" till ">"
102
+ comment comment
103
+ doctype <!DOCTYPE ... > declaration
104
+ attribute tag's attribute with or without value
105
+ value attribute's value
106
+
107
+ CSS ("css"):
108
+
109
+ tag HTML tag in selectors
110
+ id #some_name in selectors
111
+ class .some_name in selectors
112
+ at_rule @-rule till first "{" or ";"
113
+ attr_selector attribute selector (square brackets in a[href^=http://])
114
+ pseudo pseudo classes and elemens (:after, ::after etc.)
115
+ comment comment
116
+ rules everything from "{" till "}"
117
+ property property name inside a rule
118
+ value property value inside a rule, from ":" till ";" or
119
+ till the end of rule block
120
+ number number within a value
121
+ string string within a value
122
+ hexcolor hex color (#FFFFFF) within a value
123
+ function CSS function within a value
124
+ params everything between "(" and ")" within a function
125
+ important "!important" symbol
126
+
127
+ Django ("django"):
128
+
129
+ keyword HTML tag in HTML, default tags and default filters in templates
130
+ tag any tag from "<" till ">"
131
+ comment comment
132
+ doctype <!DOCTYPE ... > declaration
133
+ attribute tag's attribute with or withou value
134
+ value attribute's value
135
+ template_tag template tag {% .. %}
136
+ variable template variable {{ .. }}
137
+ template_comment template comment, both {# .. #} and {% comment %}
138
+ filter filter from "|" till the next filter or the end of tag
139
+ argument filter argument
140
+
141
+ Javascript ("javascript"):
142
+
143
+ keyword keyword
144
+ comment comment
145
+ number number
146
+ literal special literal: "true", "false" and "null"
147
+ string string
148
+ regexp regular expression
149
+ function header of a function
150
+ title name of a function inside a header
151
+ params everything inside parentheses in a function's header
152
+
153
+ VBScript ("vbscript"):
154
+
155
+ keyword keyword
156
+ number number
157
+ string string
158
+ comment comment
159
+ built_in built-in function
160
+
161
+ Lua ("lua"):
162
+
163
+ keyword keyword
164
+ number number
165
+ string string
166
+ comment comment
167
+ built_in built-in operator
168
+ function header of a function
169
+ title name of a function inside a header
170
+ params everything inside parentheses in a function's header
171
+ long_brackets multiline string in [=[ .. ]=]
172
+
173
+ Delphi ("delphi"):
174
+
175
+ keyword keyword
176
+ comment comment (of any type)
177
+ number number
178
+ string string
179
+ function header of a function, procedure, constructor and destructor
180
+ title name of a function, procedure, constructor or destructor
181
+ inside a header
182
+ params everything inside parentheses in a function's header
183
+ class class' body from "= class" till "end;"
184
+
185
+ Java ("java"):
186
+
187
+ keyword keyword
188
+ number number
189
+ string string
190
+ comment commment
191
+ annotaion annotation
192
+ javadoc javadoc comment
193
+ class class header from "class" till "{"
194
+ title class name inside a header
195
+ params everything in parentheses inside a class header
196
+ inheritance keywords "extends" and "implements" inside class header
197
+
198
+ C++ ("cpp"):
199
+
200
+ keyword keyword
201
+ number number
202
+ string string and character
203
+ comment comment
204
+ preprocessor preprocessor directive
205
+ stl_container instantiation of STL containers ("vector<...>")
206
+
207
+ Objective C ("objectivec"):
208
+ keyword keyword
209
+ built_in Cocoa/Cocoa Touch constants and classes
210
+ number number
211
+ string string
212
+ comment comment
213
+ preprocessor preprocessor directive
214
+ class interface/implementation, protocol and forward class declaration
215
+
216
+ Vala ("vala"):
217
+
218
+ keyword keyword
219
+ number number
220
+ string string
221
+ comment comment
222
+ class class definitions
223
+ title in class definition
224
+ constant ALL_UPPER_CASE
225
+
226
+ C# ("cs"):
227
+
228
+ keyword keyword
229
+ number number
230
+ string string
231
+ comment commment
232
+ xmlDocTag xmldoc tag ("///", "<!--", "-->", "<..>")
233
+
234
+ RenderMan RSL ("rsl"):
235
+
236
+ keyword keyword
237
+ number number
238
+ string string (including @"..")
239
+ comment comment
240
+ preprocessor preprocessor directive
241
+ shader sahder keywords
242
+ shading shading keywords
243
+ built_in built-in function
244
+
245
+ RenderMan RIB ("rib"):
246
+
247
+ keyword keyword
248
+ number number
249
+ string string
250
+ comment comment
251
+ commands command
252
+
253
+ Maya Embedded Language ("mel"):
254
+
255
+ keyword keyword
256
+ number number
257
+ string string
258
+ comment comment
259
+ variable variable
260
+
261
+ SQL ("sql"):
262
+
263
+ keyword keyword (mostly SQL'92 and SQL'99)
264
+ number number
265
+ string string (of any type: "..", '..', `..`)
266
+ comment comment
267
+ aggregate aggregate function
268
+
269
+ Smalltalk ("smalltalk"):
270
+
271
+ keyword keyword
272
+ number number
273
+ string string
274
+ comment commment
275
+ symbol symbol
276
+ array array
277
+ class name of a class
278
+ char char
279
+ localvars block of local variables
280
+
281
+ Lisp ("lisp"):
282
+
283
+ keyword keyword
284
+ number number
285
+ string string
286
+ comment commment
287
+ variable variable
288
+ literal b, t and nil
289
+ list non-quoted list
290
+ title first symbol in a non-quoted list
291
+ body remainder of the non-quoted list
292
+ quoted quoted list, both "(quote .. )" and "'(..)"
293
+
294
+ Ini ("ini"):
295
+
296
+ title title of a section
297
+ value value of a setting of any type
298
+ string string
299
+ number number
300
+ keyword boolean value keyword
301
+
302
+ Apache ("apache"):
303
+
304
+ keyword keyword
305
+ number number
306
+ comment commment
307
+ literal On and Off
308
+ sqbracket variables in rewrites "%{..}"
309
+ cbracket options in rewrites "[..]"
310
+ tag begin and end of a configuration section
311
+
312
+ Nginx ("nginx"):
313
+
314
+ keyword keyword
315
+ string string
316
+ number number
317
+ comment comment
318
+ built_in built-in constant
319
+ variable $-variable
320
+
321
+ Diff ("diff"):
322
+
323
+ header file header
324
+ chunk chunk header within a file
325
+ addition added lines
326
+ deletion deleted lines
327
+ change changed lines
328
+
329
+ DOS ("dos"):
330
+
331
+ keyword keyword
332
+ flow batch control keyword
333
+ stream DOS special files ("con", "prn", ...)
334
+ winutils some commands (see dos.js specifically)
335
+ envvar environment variables
336
+
337
+ Bash ("bash"):
338
+
339
+ keyword keyword
340
+ string string
341
+ number number
342
+ comment comment
343
+ literal special literal: "true" и "false"
344
+ variable variable
345
+ shebang script interpreter header
346
+
347
+ CMake ("cmake")
348
+
349
+ keyword keyword
350
+ number number
351
+ string string
352
+ comment commment
353
+ envvar $-variable
354
+
355
+ Axapta ("axapta"):
356
+
357
+ keyword keyword
358
+ number number
359
+ string string
360
+ comment commment
361
+ class class header from "class" till "{"
362
+ title class name inside a header
363
+ params everything in parentheses inside a class header
364
+ inheritance keywords "extends" and "implements" inside class header
365
+ preprocessor preprocessor directive
366
+
367
+ 1C ("1c"):
368
+
369
+ keyword keyword
370
+ number number
371
+ date date
372
+ string string
373
+ comment commment
374
+ function header of function or procudure
375
+ title function name inside a header
376
+ params everything in parentheses inside a function header
377
+ preprocessor preprocessor directive
378
+
379
+ AVR assembler ("avrasm"):
380
+
381
+ keyword keyword
382
+ built_in pre-defined register
383
+ number number
384
+ string string
385
+ comment commment
386
+ label label
387
+ preprocessor preprocessor directive
388
+ localvars substitution in .macro
389
+
390
+ VHDL ("vhdl")
391
+
392
+ keyword keyword
393
+ number number
394
+ string string
395
+ comment commment
396
+ literal signal logical value
397
+
398
+ Parser3 ("parser3"):
399
+
400
+ keyword keyword
401
+ number number
402
+ comment commment
403
+ variable variable starting with "$"
404
+ preprocessor preprocessor directive
405
+ title user-defined name starting with "@"
406
+
407
+ TeX ("tex"):
408
+
409
+ comment comment
410
+ number number
411
+ command command
412
+ parameter parameter
413
+ formula formula
414
+ special special symbol
415
+
416
+ Haskell ("haskell"):
417
+
418
+ keyword keyword
419
+ built_in built-in typeclass/functions (Bool, Int)
420
+ number number
421
+ string string
422
+ comment comment
423
+ class type classes and other data types
424
+ title function name
425
+ label type class name
426
+
427
+ Erlang ("erlang"):
428
+
429
+ comment comment
430
+ string string
431
+ number number
432
+ keyword keyword
433
+ record_name record access (#record_name)
434
+ title name of declaration function
435
+ variable variable (starts with capital letter or with _)
436
+ pp.keywords module's attribute (-attribute)
437
+ function_name atom or atom:atom in case of function call