pygments.rb 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +3 -0
  4. data/lexers +0 -0
  5. data/lib/pygments/popen.rb +3 -2
  6. data/lib/pygments/version.rb +1 -1
  7. data/pygments.rb.gemspec +2 -1
  8. data/vendor/pygments-main/AUTHORS +20 -1
  9. data/vendor/pygments-main/CHANGES +55 -3
  10. data/vendor/pygments-main/LICENSE +1 -1
  11. data/vendor/pygments-main/MANIFEST.in +1 -1
  12. data/vendor/pygments-main/Makefile +5 -8
  13. data/vendor/pygments-main/REVISION +1 -1
  14. data/vendor/pygments-main/doc/Makefile +153 -0
  15. data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
  16. data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
  17. data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
  18. data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
  19. data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
  20. data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
  21. data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
  22. data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
  23. data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
  24. data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
  25. data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
  26. data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
  27. data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
  28. data/vendor/pygments-main/doc/conf.py +249 -0
  29. data/vendor/pygments-main/doc/docs/api.rst +316 -0
  30. data/vendor/pygments-main/doc/docs/authors.rst +4 -0
  31. data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
  32. data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
  33. data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
  34. data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
  35. data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
  36. data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
  37. data/vendor/pygments-main/doc/docs/index.rst +66 -0
  38. data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
  39. data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
  40. data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
  41. data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
  42. data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
  43. data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
  44. data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
  45. data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
  46. data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
  47. data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
  48. data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
  49. data/vendor/pygments-main/doc/download.rst +41 -0
  50. data/vendor/pygments-main/doc/faq.rst +143 -0
  51. data/vendor/pygments-main/doc/index.rst +53 -0
  52. data/vendor/pygments-main/doc/languages.rst +151 -0
  53. data/vendor/pygments-main/doc/make.bat +190 -0
  54. data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
  55. data/vendor/pygments-main/external/autopygmentize +65 -48
  56. data/vendor/pygments-main/external/markdown-processor.py +15 -15
  57. data/vendor/pygments-main/external/moin-parser.py +1 -1
  58. data/vendor/pygments-main/external/rst-directive.py +2 -3
  59. data/vendor/pygments-main/ez_setup.py +340 -234
  60. data/vendor/pygments-main/pygments/__init__.py +4 -4
  61. data/vendor/pygments-main/pygments/cmdline.py +81 -68
  62. data/vendor/pygments-main/pygments/console.py +1 -1
  63. data/vendor/pygments-main/pygments/filter.py +1 -1
  64. data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
  65. data/vendor/pygments-main/pygments/formatter.py +3 -3
  66. data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
  67. data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
  68. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  69. data/vendor/pygments-main/pygments/formatters/html.py +44 -26
  70. data/vendor/pygments-main/pygments/formatters/img.py +21 -14
  71. data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
  72. data/vendor/pygments-main/pygments/formatters/other.py +53 -6
  73. data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
  74. data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
  75. data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
  76. data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
  77. data/vendor/pygments-main/pygments/lexer.py +59 -39
  78. data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
  79. data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
  80. data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
  81. data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
  82. data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
  83. data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
  84. data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
  85. data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
  86. data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
  87. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
  88. data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
  89. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
  90. data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
  91. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
  92. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
  93. data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
  94. data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
  95. data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
  96. data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
  97. data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
  98. data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
  99. data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
  100. data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
  101. data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
  102. data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
  103. data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
  104. data/vendor/pygments-main/pygments/lexers/math.py +438 -70
  105. data/vendor/pygments-main/pygments/lexers/other.py +885 -171
  106. data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
  107. data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
  108. data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
  109. data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
  110. data/vendor/pygments-main/pygments/lexers/special.py +7 -8
  111. data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
  112. data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
  113. data/vendor/pygments-main/pygments/lexers/text.py +208 -46
  114. data/vendor/pygments-main/pygments/lexers/web.py +729 -264
  115. data/vendor/pygments-main/pygments/modeline.py +1 -1
  116. data/vendor/pygments-main/pygments/plugin.py +1 -1
  117. data/vendor/pygments-main/pygments/scanner.py +1 -1
  118. data/vendor/pygments-main/pygments/sphinxext.py +153 -0
  119. data/vendor/pygments-main/pygments/style.py +3 -2
  120. data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
  121. data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
  122. data/vendor/pygments-main/pygments/styles/borland.py +1 -1
  123. data/vendor/pygments-main/pygments/styles/bw.py +1 -1
  124. data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
  125. data/vendor/pygments-main/pygments/styles/default.py +1 -1
  126. data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
  127. data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
  128. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  129. data/vendor/pygments-main/pygments/styles/igor.py +29 -0
  130. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  131. data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
  132. data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
  133. data/vendor/pygments-main/pygments/styles/native.py +1 -1
  134. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
  135. data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
  136. data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
  137. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
  138. data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
  139. data/vendor/pygments-main/pygments/styles/tango.py +1 -1
  140. data/vendor/pygments-main/pygments/styles/trac.py +1 -1
  141. data/vendor/pygments-main/pygments/styles/vim.py +1 -1
  142. data/vendor/pygments-main/pygments/styles/vs.py +1 -1
  143. data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
  144. data/vendor/pygments-main/pygments/token.py +4 -1
  145. data/vendor/pygments-main/pygments/unistring.py +6 -5
  146. data/vendor/pygments-main/pygments/util.py +35 -21
  147. data/vendor/pygments-main/scripts/check_sources.py +28 -44
  148. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
  149. data/vendor/pygments-main/scripts/find_codetags.py +27 -19
  150. data/vendor/pygments-main/scripts/find_error.py +16 -13
  151. data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
  152. data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
  153. data/vendor/pygments-main/setup.py +19 -19
  154. data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
  155. data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
  156. data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
  157. data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
  158. data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
  159. data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
  160. data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
  161. data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
  162. data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
  163. data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
  164. data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
  165. data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
  166. data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
  167. data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
  168. data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
  169. data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
  170. data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
  171. data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
  172. data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
  173. data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
  174. data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
  175. data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
  176. data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
  177. data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
  178. data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
  179. data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
  180. data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
  181. data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
  182. data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
  183. data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
  184. data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
  185. data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
  186. data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
  187. data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
  188. data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
  189. data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
  190. data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
  191. data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
  192. data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
  193. data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
  194. data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
  195. data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
  196. data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
  197. data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
  198. data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
  199. data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
  200. data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
  201. data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
  202. data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
  203. data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
  204. data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
  205. data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
  206. data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
  207. data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
  208. data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
  209. data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
  210. data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
  211. data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
  212. data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
  213. data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
  214. data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
  215. data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
  216. data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
  217. data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
  218. data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
  219. data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
  220. data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
  221. data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
  222. data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
  223. data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
  224. data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
  225. data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
  226. data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
  227. data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
  228. data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
  229. data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
  230. data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
  231. data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
  232. data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
  233. data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
  234. data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
  235. data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
  236. data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
  237. data/vendor/pygments-main/tests/run.py +14 -19
  238. data/vendor/pygments-main/tests/string_asserts.py +22 -0
  239. data/vendor/pygments-main/tests/test_basic_api.py +28 -14
  240. data/vendor/pygments-main/tests/test_cfm.py +46 -0
  241. data/vendor/pygments-main/tests/test_clexer.py +208 -3
  242. data/vendor/pygments-main/tests/test_cmdline.py +6 -5
  243. data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
  244. data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
  245. data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
  246. data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
  247. data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
  248. data/vendor/pygments-main/tests/test_perllexer.py +1 -1
  249. data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
  250. data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
  251. data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
  252. data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
  253. data/vendor/pygments-main/tests/test_token.py +3 -3
  254. data/vendor/pygments-main/tests/test_using_api.py +1 -1
  255. data/vendor/pygments-main/tests/test_util.py +1 -1
  256. metadata +138 -51
  257. data/vendor/pygments-main/docs/generate.py +0 -472
  258. data/vendor/pygments-main/docs/src/api.txt +0 -270
  259. data/vendor/pygments-main/docs/src/authors.txt +0 -5
  260. data/vendor/pygments-main/docs/src/changelog.txt +0 -5
  261. data/vendor/pygments-main/docs/src/index.txt +0 -69
  262. data/vendor/pygments-main/docs/src/installation.txt +0 -71
  263. data/vendor/pygments-main/external/rst-directive-old.py +0 -77
  264. data/vendor/pygments-main/scripts/reindent.py +0 -291
  265. data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
  266. data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
  267. data/vendor/pygments-main/tests/old_run.py +0 -138
@@ -5,7 +5,7 @@
5
5
 
6
6
  A simple modeline parser (based on pymodeline).
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -32,7 +32,7 @@
32
32
  yourfilter = yourfilter:YourFilter
33
33
 
34
34
 
35
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
35
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
36
36
  :license: BSD, see LICENSE for details.
37
37
  """
38
38
  try:
@@ -12,7 +12,7 @@
12
12
  Have a look at the `DelphiLexer` to get an idea of how to use
13
13
  this scanner.
14
14
 
15
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
15
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
16
16
  :license: BSD, see LICENSE for details.
17
17
  """
18
18
  import re
@@ -0,0 +1,153 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.sphinxext
4
+ ~~~~~~~~~~~~~~~~~~
5
+
6
+ Sphinx extension to generate automatic documentation of lexers,
7
+ formatters and filters.
8
+
9
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
10
+ :license: BSD, see LICENSE for details.
11
+ """
12
+
13
+ from __future__ import print_function
14
+
15
+ import sys
16
+
17
+ from docutils import nodes
18
+ from docutils.statemachine import ViewList
19
+ from sphinx.util.compat import Directive
20
+ from sphinx.util.nodes import nested_parse_with_titles
21
+
22
+
23
+ MODULEDOC = '''
24
+ .. module:: %s
25
+
26
+ %s
27
+ %s
28
+ '''
29
+
30
+ LEXERDOC = '''
31
+ .. class:: %s
32
+
33
+ :Short names: %s
34
+ :Filenames: %s
35
+ :MIME types: %s
36
+
37
+ %s
38
+
39
+ '''
40
+
41
+ FMTERDOC = '''
42
+ .. class:: %s
43
+
44
+ :Short names: %s
45
+ :Filenames: %s
46
+
47
+ %s
48
+
49
+ '''
50
+
51
+ FILTERDOC = '''
52
+ .. class:: %s
53
+
54
+ :Name: %s
55
+
56
+ %s
57
+
58
+ '''
59
+
60
+ class PygmentsDoc(Directive):
61
+ """
62
+ A directive to collect all lexers/formatters/filters and generate
63
+ autoclass directives for them.
64
+ """
65
+ has_content = False
66
+ required_arguments = 1
67
+ optional_arguments = 0
68
+ final_argument_whitespace = False
69
+ option_spec = {}
70
+
71
+ def run(self):
72
+ self.filenames = set()
73
+ if self.arguments[0] == 'lexers':
74
+ out = self.document_lexers()
75
+ elif self.arguments[0] == 'formatters':
76
+ out = self.document_formatters()
77
+ elif self.arguments[0] == 'filters':
78
+ out = self.document_filters()
79
+ else:
80
+ raise Exception('invalid argument for "pygmentsdoc" directive')
81
+ node = nodes.compound()
82
+ vl = ViewList(out.split('\n'), source='')
83
+ nested_parse_with_titles(self.state, vl, node)
84
+ for fn in self.filenames:
85
+ self.state.document.settings.record_dependencies.add(fn)
86
+ return node.children
87
+
88
+ def document_lexers(self):
89
+ from pygments.lexers._mapping import LEXERS
90
+ out = []
91
+ modules = {}
92
+ moduledocstrings = {}
93
+ for classname, data in sorted(LEXERS.items(), key=lambda x: x[0]):
94
+ module = data[0]
95
+ mod = __import__(module, None, None, [classname])
96
+ self.filenames.add(mod.__file__)
97
+ cls = getattr(mod, classname)
98
+ if not cls.__doc__:
99
+ print("Warning: %s does not have a docstring." % classname)
100
+ docstring = cls.__doc__
101
+ if isinstance(docstring, bytes):
102
+ docstring = docstring.decode('utf8')
103
+ modules.setdefault(module, []).append((
104
+ classname,
105
+ ', '.join(data[2]) or 'None',
106
+ ', '.join(data[3]).replace('*', '\\*').replace('_', '\\') or 'None',
107
+ ', '.join(data[4]) or 'None',
108
+ docstring))
109
+ if module not in moduledocstrings:
110
+ moddoc = mod.__doc__
111
+ if isinstance(moddoc, bytes):
112
+ moddoc = moddoc.decode('utf8')
113
+ moduledocstrings[module] = moddoc
114
+
115
+ for module, lexers in sorted(modules.items(), key=lambda x: x[0]):
116
+ heading = moduledocstrings[module].splitlines()[4].strip().rstrip('.')
117
+ out.append(MODULEDOC % (module, heading, '-'*len(heading)))
118
+ for data in lexers:
119
+ out.append(LEXERDOC % data)
120
+
121
+ return ''.join(out)
122
+
123
+ def document_formatters(self):
124
+ from pygments.formatters import FORMATTERS
125
+
126
+ out = []
127
+ for cls, data in sorted(FORMATTERS.items(),
128
+ key=lambda x: x[0].__name__):
129
+ self.filenames.add(sys.modules[cls.__module__].__file__)
130
+ docstring = cls.__doc__
131
+ if isinstance(docstring, bytes):
132
+ docstring = docstring.decode('utf8')
133
+ heading = cls.__name__
134
+ out.append(FMTERDOC % (heading, ', '.join(data[1]) or 'None',
135
+ ', '.join(data[2]).replace('*', '\\*') or 'None',
136
+ docstring))
137
+ return ''.join(out)
138
+
139
+ def document_filters(self):
140
+ from pygments.filters import FILTERS
141
+
142
+ out = []
143
+ for name, cls in FILTERS.items():
144
+ self.filenames.add(sys.modules[cls.__module__].__file__)
145
+ docstring = cls.__doc__
146
+ if isinstance(docstring, bytes):
147
+ docstring = docstring.decode('utf8')
148
+ out.append(FILTERDOC % (cls.__name__, name, docstring))
149
+ return ''.join(out)
150
+
151
+
152
+ def setup(app):
153
+ app.add_directive('pygmentsdoc', PygmentsDoc)
@@ -5,11 +5,12 @@
5
5
 
6
6
  Basic style object.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
12
12
  from pygments.token import Token, STANDARD_TYPES
13
+ from pygments.util import add_metaclass
13
14
 
14
15
 
15
16
  class StyleMeta(type):
@@ -104,8 +105,8 @@ class StyleMeta(type):
104
105
  return len(cls._styles)
105
106
 
106
107
 
108
+ @add_metaclass(StyleMeta)
107
109
  class Style(object):
108
- __metaclass__ = StyleMeta
109
110
 
110
111
  #: overall background color (``None`` means transparent)
111
112
  background_color = '#ffffff'
@@ -5,7 +5,7 @@
5
5
 
6
6
  Contains built-in styles.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -34,6 +34,10 @@ STYLE_MAP = {
34
34
  'vs': 'vs::VisualStudioStyle',
35
35
  'tango': 'tango::TangoStyle',
36
36
  'rrt': 'rrt::RrtStyle',
37
+ 'xcode': 'xcode::XcodeStyle',
38
+ 'igor': 'igor::IgorStyle',
39
+ 'paraiso-light': 'paraiso_light::ParaisoLightStyle',
40
+ 'paraiso-dark': 'paraiso_dark::ParaisoDarkStyle',
37
41
  }
38
42
 
39
43
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  A colorful style, inspired by the terminal highlighting style.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Style similar to the style used in the Borland IDEs.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Simple black/white only style.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  A colorful style, inspired by CodeRay.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The default highlighting style.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  A highlighting style for Pygments, inspired by Emacs.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  A modern style based on the VIM pyte theme.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  pygments version of my "fruity" vim theme.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -0,0 +1,29 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.igor
4
+ ~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Igor Pro default style.
7
+
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ from pygments.style import Style
13
+ from pygments.token import Keyword, Name, Comment, String
14
+
15
+
16
+ class IgorStyle(Style):
17
+ """
18
+ Pygments version of the official colors for Igor Pro procedures.
19
+ """
20
+ default_style = ""
21
+
22
+ styles = {
23
+ Comment: 'italic #FF0000',
24
+ Keyword: '#0000FF',
25
+ Name.Function: '#C34E00',
26
+ Name.Decorator: '#CC00A3',
27
+ Name.Class: '#007575',
28
+ String: '#009C00'
29
+ }
@@ -8,7 +8,7 @@
8
8
  This is a port of the style used in the `php port`_ of pygments
9
9
  by Manni. The style is called 'default' there.
10
10
 
11
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
11
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
12
12
  :license: BSD, see LICENSE for details.
13
13
  """
14
14
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
9
9
 
10
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
10
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
11
11
  :license: BSD, see LICENSE for details.
12
12
  """
13
13
 
@@ -93,14 +93,14 @@ class MonokaiStyle(Style):
93
93
  String.Symbol: "", # class: 'ss'
94
94
 
95
95
  Generic: "", # class: 'g'
96
- Generic.Deleted: "", # class: 'gd',
96
+ Generic.Deleted: "#f92672", # class: 'gd',
97
97
  Generic.Emph: "italic", # class: 'ge'
98
98
  Generic.Error: "", # class: 'gr'
99
99
  Generic.Heading: "", # class: 'gh'
100
- Generic.Inserted: "", # class: 'gi'
100
+ Generic.Inserted: "#a6e22e", # class: 'gi'
101
101
  Generic.Output: "", # class: 'go'
102
102
  Generic.Prompt: "", # class: 'gp'
103
103
  Generic.Strong: "bold", # class: 'gs'
104
- Generic.Subheading: "", # class: 'gu'
104
+ Generic.Subheading: "#75715e", # class: 'gu'
105
105
  Generic.Traceback: "", # class: 'gt'
106
106
  }
@@ -5,7 +5,7 @@
5
5
 
6
6
  Murphy's style from CodeRay.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  pygments version of my "native" vim theme.
7
7
 
8
- :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
8
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
9
9
  :license: BSD, see LICENSE for details.
10
10
  """
11
11
 
@@ -0,0 +1,125 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.paraiso_dark
4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Paraíso (Dark) by Jan T. Sott
7
+
8
+ Pygments template by Jan T. Sott (https://github.com/idleberg)
9
+ Created with Base16 Builder by Chris Kempson
10
+ (https://github.com/chriskempson/base16-builder).
11
+
12
+ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
13
+ :license: BSD, see LICENSE for details.
14
+ """
15
+
16
+ from pygments.style import Style
17
+ from pygments.token import Keyword, Name, Comment, String, Error, Text, \
18
+ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
19
+
20
+
21
+ BACKGROUND = "#2f1e2e"
22
+ CURRENT_LINE = "#41323f"
23
+ SELECTION = "#4f424c"
24
+ FOREGROUND = "#e7e9db"
25
+ COMMENT = "#776e71"
26
+ RED = "#ef6155"
27
+ ORANGE = "#f99b15"
28
+ YELLOW = "#fec418"
29
+ GREEN = "#48b685"
30
+ AQUA = "#5bc4bf"
31
+ BLUE = "#06b6ef"
32
+ PURPLE = "#815ba4"
33
+
34
+
35
+ class ParaisoDarkStyle(Style):
36
+
37
+ default_style = ''
38
+
39
+ background_color = BACKGROUND
40
+ highlight_color = SELECTION
41
+
42
+ background_color = BACKGROUND
43
+ highlight_color = SELECTION
44
+
45
+ styles = {
46
+ # No corresponding class for the following:
47
+ Text: FOREGROUND, # class: ''
48
+ Whitespace: "", # class: 'w'
49
+ Error: RED, # class: 'err'
50
+ Other: "", # class 'x'
51
+
52
+ Comment: COMMENT, # class: 'c'
53
+ Comment.Multiline: "", # class: 'cm'
54
+ Comment.Preproc: "", # class: 'cp'
55
+ Comment.Single: "", # class: 'c1'
56
+ Comment.Special: "", # class: 'cs'
57
+
58
+ Keyword: PURPLE, # class: 'k'
59
+ Keyword.Constant: "", # class: 'kc'
60
+ Keyword.Declaration: "", # class: 'kd'
61
+ Keyword.Namespace: AQUA, # class: 'kn'
62
+ Keyword.Pseudo: "", # class: 'kp'
63
+ Keyword.Reserved: "", # class: 'kr'
64
+ Keyword.Type: YELLOW, # class: 'kt'
65
+
66
+ Operator: AQUA, # class: 'o'
67
+ Operator.Word: "", # class: 'ow' - like keywords
68
+
69
+ Punctuation: FOREGROUND, # class: 'p'
70
+
71
+ Name: FOREGROUND, # class: 'n'
72
+ Name.Attribute: BLUE, # class: 'na' - to be revised
73
+ Name.Builtin: "", # class: 'nb'
74
+ Name.Builtin.Pseudo: "", # class: 'bp'
75
+ Name.Class: YELLOW, # class: 'nc' - to be revised
76
+ Name.Constant: RED, # class: 'no' - to be revised
77
+ Name.Decorator: AQUA, # class: 'nd' - to be revised
78
+ Name.Entity: "", # class: 'ni'
79
+ Name.Exception: RED, # class: 'ne'
80
+ Name.Function: BLUE, # class: 'nf'
81
+ Name.Property: "", # class: 'py'
82
+ Name.Label: "", # class: 'nl'
83
+ Name.Namespace: YELLOW, # class: 'nn' - to be revised
84
+ Name.Other: BLUE, # class: 'nx'
85
+ Name.Tag: AQUA, # class: 'nt' - like a keyword
86
+ Name.Variable: RED, # class: 'nv' - to be revised
87
+ Name.Variable.Class: "", # class: 'vc' - to be revised
88
+ Name.Variable.Global: "", # class: 'vg' - to be revised
89
+ Name.Variable.Instance: "", # class: 'vi' - to be revised
90
+
91
+ Number: ORANGE, # class: 'm'
92
+ Number.Float: "", # class: 'mf'
93
+ Number.Hex: "", # class: 'mh'
94
+ Number.Integer: "", # class: 'mi'
95
+ Number.Integer.Long: "", # class: 'il'
96
+ Number.Oct: "", # class: 'mo'
97
+
98
+ Literal: ORANGE, # class: 'l'
99
+ Literal.Date: GREEN, # class: 'ld'
100
+
101
+ String: GREEN, # class: 's'
102
+ String.Backtick: "", # class: 'sb'
103
+ String.Char: FOREGROUND, # class: 'sc'
104
+ String.Doc: COMMENT, # class: 'sd' - like a comment
105
+ String.Double: "", # class: 's2'
106
+ String.Escape: ORANGE, # class: 'se'
107
+ String.Heredoc: "", # class: 'sh'
108
+ String.Interpol: ORANGE, # class: 'si'
109
+ String.Other: "", # class: 'sx'
110
+ String.Regex: "", # class: 'sr'
111
+ String.Single: "", # class: 's1'
112
+ String.Symbol: "", # class: 'ss'
113
+
114
+ Generic: "", # class: 'g'
115
+ Generic.Deleted: RED, # class: 'gd',
116
+ Generic.Emph: "italic", # class: 'ge'
117
+ Generic.Error: "", # class: 'gr'
118
+ Generic.Heading: "bold " + FOREGROUND, # class: 'gh'
119
+ Generic.Inserted: GREEN, # class: 'gi'
120
+ Generic.Output: "", # class: 'go'
121
+ Generic.Prompt: "bold " + COMMENT, # class: 'gp'
122
+ Generic.Strong: "bold", # class: 'gs'
123
+ Generic.Subheading: "bold " + AQUA, # class: 'gu'
124
+ Generic.Traceback: "", # class: 'gt'
125
+ }