pygments.rb 0.5.4 → 0.6.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 (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
@@ -3,8 +3,8 @@ Unicode and Encodings
3
3
  =====================
4
4
 
5
5
  Since Pygments 0.6, all lexers use unicode strings internally. Because of that
6
- you might encounter the occasional `UnicodeDecodeError` if you pass strings with the
7
- wrong encoding.
6
+ you might encounter the occasional :exc:`UnicodeDecodeError` if you pass strings
7
+ with the wrong encoding.
8
8
 
9
9
  Per default all lexers have their input encoding set to `latin1`.
10
10
  If you pass a lexer a string object (not unicode), it tries to decode the data
@@ -39,11 +39,12 @@ Unicode string with this encoding before writing it. This is the case for
39
39
  `sys.stdout`, for example. The other formatters don't have that behavior.
40
40
 
41
41
  Another note: If you call Pygments via the command line (`pygmentize`),
42
- encoding is handled differently, see `the command line docs <cmdline.txt>`_.
42
+ encoding is handled differently, see :doc:`the command line docs <cmdline>`.
43
43
 
44
- *New in Pygments 0.7*: the formatters now also accept an `outencoding` option
45
- which will override the `encoding` option if given. This makes it possible to
46
- use a single options dict with lexers and formatters, and still have different
47
- input and output encodings.
44
+ .. versionadded:: 0.7
45
+ The formatters now also accept an `outencoding` option which will override
46
+ the `encoding` option if given. This makes it possible to use a single
47
+ options dict with lexers and formatters, and still have different input and
48
+ output encodings.
48
49
 
49
50
  .. _chardet: http://chardet.feedparser.org/
@@ -0,0 +1,41 @@
1
+ Download and installation
2
+ =========================
3
+
4
+ The current release is version |version|.
5
+
6
+ Packaged versions
7
+ -----------------
8
+
9
+ You can download it `from the Python Package Index
10
+ <http://pypi.python.org/pypi/Pygments>`_. For installation of packages from
11
+ PyPI, we recommend `Pip <http://www.pip-installer.org>`_, which works on all
12
+ major platforms.
13
+
14
+ Under Linux, most distributions include a package for Pygments, usually called
15
+ ``pygments`` or ``python-pygments``. You can install it with the package
16
+ manager as usual.
17
+
18
+ Development sources
19
+ -------------------
20
+
21
+ We're using the `Mercurial <http://selenic.com/mercurial>`_ version control
22
+ system. You can get the development source using this command::
23
+
24
+ hg clone http://bitbucket.org/birkenfeld/pygments-main pygments
25
+
26
+ Development takes place at `Bitbucket
27
+ <http://bitbucket.org/birkenfeld/pygments-main>`_, you can browse the source
28
+ online `here <http://bitbucket.org/birkenfeld/pygments-main/src>`_.
29
+
30
+ The latest changes in the development source code are listed in the `changelog
31
+ <http://bitbucket.org/birkenfeld/pygments-main/src/tip/CHANGES>`_.
32
+
33
+ .. Documentation
34
+ -------------
35
+
36
+ .. XXX todo
37
+
38
+ You can download the <a href="/docs/">documentation</a> either as
39
+ a bunch of rst files from the Mercurial repository, see above, or
40
+ as a tar.gz containing rendered HTML files:</p>
41
+ <p><a href="/docs/download/pygmentsdocs.tar.gz">pygmentsdocs.tar.gz</a></p>
@@ -0,0 +1,143 @@
1
+ :orphan:
2
+
3
+ Pygments FAQ
4
+ =============
5
+
6
+ What is Pygments?
7
+ -----------------
8
+
9
+ Pygments is a syntax highlighting engine written in Python. That means, it will
10
+ take source code (or other markup) in a supported language and output a
11
+ processed version (in different formats) containing syntax highlighting markup.
12
+
13
+ Its features include:
14
+
15
+ * a wide range of common languages and markup formats is supported (look here
16
+ for a list)
17
+ * new languages and formats are added easily
18
+ * a number of output formats is available, including:
19
+
20
+ - HTML
21
+ - ANSI sequences (console output)
22
+ - LaTeX
23
+ - RTF
24
+
25
+ * it is usable as a command-line tool and as a library
26
+ * parsing and formatting is fast
27
+
28
+ Pygments is licensed under the BSD license.
29
+
30
+ Where does the name Pygments come from?
31
+ ---------------------------------------
32
+
33
+ *Py* of course stands for Python, while *pigments* are used for coloring paint,
34
+ and in this case, source code!
35
+
36
+ What are the system requirements?
37
+ ---------------------------------
38
+
39
+ Pygments only needs a standard Python install, version 2.6 or higher or version
40
+ 3.3 or higher for Python 3. No additional libraries are needed.
41
+
42
+ How can I use Pygments?
43
+ -----------------------
44
+
45
+ Pygments is usable as a command-line tool as well as a library.
46
+
47
+ From the command-line, usage looks like this (assuming the pygmentize script is
48
+ properly installed)::
49
+
50
+ pygmentize -f html /path/to/file.py
51
+
52
+ This will print a HTML-highlighted version of /path/to/file.py to standard output.
53
+
54
+ For a complete help, please run ``pygmentize -h``.
55
+
56
+ Usage as a library is thoroughly demonstrated in the Documentation section.
57
+
58
+ How do I make a new style?
59
+ --------------------------
60
+
61
+ Please see the documentation on styles.
62
+
63
+ How can I report a bug or suggest a feature?
64
+ --------------------------------------------
65
+
66
+ Please report bugs and feature wishes in the tracker at Bitbucket.
67
+
68
+ You can also e-mail the author or use IRC, see the contact details.
69
+
70
+ I want this support for this language!
71
+ --------------------------------------
72
+
73
+ Instead of waiting for others to include language support, why not write it
74
+ yourself? All you have to know is :doc:`outlined in the docs
75
+ <docs/lexerdevelopment>`.
76
+
77
+ Can I use Pygments for programming language processing?
78
+ -------------------------------------------------------
79
+
80
+ The Pygments lexing machinery is quite powerful can be used to build lexers for
81
+ basically all languages. However, parsing them is not possible, though some
82
+ lexers go some steps in this direction in order to e.g. highlight function names
83
+ differently.
84
+
85
+ Also, error reporting is not the scope of Pygments. It focuses on correctly
86
+ highlighting syntactically valid documents, not finding and compensating errors.
87
+
88
+ Who uses Pygments?
89
+ ------------------
90
+
91
+ This is an (incomplete) list of projects and sites known to use the Pygments highlighter.
92
+
93
+ * `Pygments API <http://pygments.appspot.com/>`_, a HTTP POST interface to Pygments
94
+ * `The Sphinx documentation builder <http://sphinx.pocoo.org/>`_, for embedded source examples
95
+ * `rst2pdf <http://code.google.com/p/rst2pdf/>`_, a reStructuredText to PDF converter
96
+ * `Zine <http://zine.pocoo.org/>`_, a Python blogging system
97
+ * `Trac <http://trac.edgewall.org/>`_, the universal project management tool
98
+ * `Bruce <http://r1chardj0n3s.googlepages.com/bruce>`_, a reStructuredText presentation tool
99
+ * `AsciiDoc <http://www.methods.co.nz/asciidoc/>`_, a text-based documentation generator
100
+ * `ActiveState Code <http://code.activestate.com/>`_, the Python Cookbook successor
101
+ * `ViewVC <http://viewvc.org/>`_, a web-based version control repository browser
102
+ * `BzrFruit <http://repo.or.cz/w/bzrfruit.git>`_, a Bazaar branch viewer
103
+ * `QBzr <http://bazaar-vcs.org/QBzr>`_, a cross-platform Qt-based GUI front end for Bazaar
104
+ * `BitBucket <http://bitbucket.org/>`_, a Mercurial and Git hosting site
105
+ * `GitHub <http://github.com/>`_, a site offering secure Git hosting and collaborative development
106
+ * `Review Board <http://www.review-board.org/>`_, a collaborative code reviewing tool
107
+ * `skeletonz <http://orangoo.com/skeletonz/>`_, a Python powered content management system
108
+ * `Diamanda <http://code.google.com/p/diamanda/>`_, a Django powered wiki system with support for Pygments
109
+ * `Progopedia <http://progopedia.ru/>`_ (`English <http://progopedia.com/>`_),
110
+ an encyclopedia of programming languages
111
+ * `Postmarkup <http://code.google.com/p/postmarkup/>`_, a BBCode to XHTML generator
112
+ * `Language Comparison <http://michaelsilver.us/lc>`_, a site that compares different programming languages
113
+ * `BPython <http://www.noiseforfree.com/bpython/>`_, a curses-based intelligent Python shell
114
+ * `Challenge-You! <http://challenge-you.appspot.com/>`_, a site offering programming challenges
115
+ * `PIDA <http://pida.co.uk/>`_, a universal IDE written in Python
116
+ * `PuDB <http://pypi.python.org/pypi/pudb>`_, a console Python debugger
117
+ * `XWiki <http://www.xwiki.org/>`_, a wiki-based development framework in Java, using Jython
118
+ * `roux <http://ananelson.com/software/roux/>`_, a script for running R scripts
119
+ and creating beautiful output including graphs
120
+ * `hurl <http://hurl.it/>`_, a web service for making HTTP requests
121
+ * `wxHTMLPygmentizer <http://colinbarnette.net/projects/wxHTMLPygmentizer>`_ is
122
+ a GUI utility, used to make code-colorization easier
123
+ * `WpPygments <http://blog.mirotin.net/?page_id=49>`_, a highlighter plugin for WordPress
124
+ * `LodgeIt <http://paste.pocoo.org/>`_, a pastebin with XMLRPC support and diffs
125
+ * `SpammCan <http://chrisarndt.de/projects/spammcan/>`_, a pastebin (demo see
126
+ `here <http://paste.chrisarndt.de/>`_)
127
+ * `WowAce.com pastes <http://www.wowace.com/paste/>`_, a pastebin
128
+ * `Siafoo <http://siafoo.net>`_, a tool for sharing and storing useful code and programming experience
129
+ * `D source <http://www.dsource.org/>`_, a community for the D programming language
130
+ * `dumpz.org <http://dumpz.org/>`_, a pastebin
131
+ * `dpaste.com <http://dpaste.com/>`_, another Django pastebin
132
+ * `PylonsHQ Pasties <http://pylonshq.com/pasties/new>`_, a pastebin
133
+ * `Django snippets <http://www.djangosnippets.org/>`_, a pastebin for Django code
134
+ * `Fayaa <http://www.fayaa.com/code/>`_, a Chinese pastebin
135
+ * `Incollo.com <http://incollo.com>`_, a free collaborative debugging tool
136
+ * `PasteBox <http://p.boxnet.eu/>`_, a pastebin focused on privacy
137
+ * `xinotes.org <http://www.xinotes.org/>`_, a site to share notes, code snippets etc.
138
+ * `hilite.me <http://www.hilite.me/>`_, a site to highlight code snippets
139
+ * `patx.me <http://patx.me/paste>`_, a pastebin
140
+
141
+ If you have a project or web site using Pygments, drop me a line, and I'll add a
142
+ link here.
143
+
@@ -0,0 +1,53 @@
1
+ Welcome!
2
+ ========
3
+
4
+ This is the home of Pygments. It is a generic syntax highlighter for general use
5
+ in all kinds of software such as forum systems, wikis or other applications that
6
+ need to prettify source code. Highlights are:
7
+
8
+ * a wide range of common languages and markup formats is supported
9
+ * special attention is paid to details that increase highlighting quality
10
+ * support for new languages and formats are added easily; most languages use a simple regex-based lexing mechanism
11
+ * a number of output formats is available, among them HTML, RTF, LaTeX and ANSI sequences
12
+ * it is usable as a command-line tool and as a library
13
+ * ... and it highlights even Brainf*ck!
14
+
15
+ Read more in the FAQ list or the documentation, or download the latest release.
16
+
17
+ Though Pygments has not yet won an award, we trust that you will notice it's a top quality product <wink>.
18
+
19
+ .. _contribute:
20
+
21
+ Contribute
22
+ ----------
23
+
24
+ Like every open-source project, we are always looking for volunteers to help us
25
+ with programming. Python knowledge is required, but don't fear: Python is a very
26
+ clear and easy to learn language.
27
+
28
+ Development takes place on `Bitbucket
29
+ <https://bitbucket.org/birkenfeld/pygments-main>`_, where the Mercurial
30
+ repository, tickets and pull requests can be viewed.
31
+
32
+ Our primary communication instrument is the IRC channel **#pocoo** on the
33
+ Freenode network. To join it, let your IRC client connect to
34
+ ``irc.freenode.net`` and do ``/join #pocoo``.
35
+
36
+ If you found a bug, just open a ticket in the Bitbucket tracker. Be sure to log
37
+ in to be notified when the issue is fixed -- development is not fast-paced as
38
+ the library is quite stable. You can also send an e-mail to the developers, see
39
+ below.
40
+
41
+ The authors
42
+ -----------
43
+
44
+ Pygments is maintained by **Georg Brandl**, e-mail address *georg*\ *@*\ *python.org*.
45
+
46
+ Many lexers and fixes have been contributed by **Armin Ronacher**, the rest of
47
+ the `Pocoo <http://dev.pocoo.org/>`_ team and **Tim Hatch**.
48
+
49
+ .. toctree::
50
+ :maxdepth: 1
51
+ :hidden:
52
+
53
+ docs/index
@@ -0,0 +1,151 @@
1
+ :orphan:
2
+
3
+ Supported languages
4
+ ===================
5
+
6
+ Pygments supports an ever-growing range of languages. Watch this space...
7
+
8
+ Programming languages
9
+ ---------------------
10
+
11
+ * ActionScript
12
+ * Ada
13
+ * ANTLR
14
+ * AppleScript
15
+ * Assembly (various)
16
+ * Asymptote
17
+ * Awk
18
+ * Befunge
19
+ * Boo
20
+ * BrainFuck
21
+ * C, C++
22
+ * C#
23
+ * Clojure
24
+ * CoffeeScript
25
+ * ColdFusion
26
+ * Common Lisp
27
+ * Coq
28
+ * Cryptol (incl. Literate Cryptol)
29
+ * `Cython <http://cython.org>`_
30
+ * `D <http://digitalmars.com/d>`_
31
+ * Dart
32
+ * Delphi
33
+ * Dylan
34
+ * Erlang
35
+ * Factor
36
+ * Fancy
37
+ * Fortran
38
+ * F#
39
+ * GAP
40
+ * Gherkin (Cucumber)
41
+ * GL shaders
42
+ * Groovy
43
+ * `Haskell <http://www.haskell.org>`_ (incl. Literate Haskell)
44
+ * IDL
45
+ * Io
46
+ * Java
47
+ * JavaScript
48
+ * LLVM
49
+ * Logtalk
50
+ * `Lua <http://www.lua.org>`_
51
+ * Matlab
52
+ * MiniD
53
+ * Modelica
54
+ * Modula-2
55
+ * MuPad
56
+ * Nemerle
57
+ * Nimrod
58
+ * Objective-C
59
+ * Objective-J
60
+ * Octave
61
+ * OCaml
62
+ * PHP
63
+ * `Perl <http://perl.org>`_
64
+ * PovRay
65
+ * PostScript
66
+ * PowerShell
67
+ * Prolog
68
+ * `Python <http://www.python.org>`_ 2.x and 3.x (incl. console sessions and tracebacks)
69
+ * `REBOL <http://www.rebol.com>`_
70
+ * `Red <http://www.red-lang.org>`_
71
+ * Redcode
72
+ * `Ruby <http://www.ruby-lang.org>`_ (incl. irb sessions)
73
+ * Rust
74
+ * S, S-Plus, R
75
+ * Scala
76
+ * Scheme
77
+ * Scilab
78
+ * Smalltalk
79
+ * SNOBOL
80
+ * Tcl
81
+ * Vala
82
+ * Verilog
83
+ * VHDL
84
+ * Visual Basic.NET
85
+ * Visual FoxPro
86
+ * XQuery
87
+ * Zephir
88
+ </ul>
89
+
90
+ Template languages
91
+ ------------------
92
+
93
+ * Cheetah templates
94
+ * `Django <http://www.djangoproject.com>`_ / `Jinja
95
+ <http://jinja.pocoo.org/jinja>`_ templates
96
+ * ERB (Ruby templating)
97
+ * `Genshi <http://genshi.edgewall.org>`_ (the Trac template language)
98
+ * JSP (Java Server Pages)
99
+ * `Myghty <http://www.myghty.org>`_ (the HTML::Mason based framework)
100
+ * `Mako <http://www.makotemplates.org/>`_ (the Myghty successor)
101
+ * `Smarty <http://smarty.php.net>`_ templates (PHP templating)
102
+ * Tea
103
+
104
+ Other markup
105
+ ------------
106
+
107
+ * Apache config files
108
+ * Bash shell scripts
109
+ * BBCode
110
+ * CMake
111
+ * CSS
112
+ * Debian control files
113
+ * Diff files
114
+ * DTD
115
+ * Gettext catalogs
116
+ * Gnuplot script
117
+ * Groff markup
118
+ * HTML
119
+ * HTTP sessions
120
+ * INI-style config files
121
+ * IRC logs (irssi style)
122
+ * Lighttpd config files
123
+ * Makefiles
124
+ * MoinMoin/Trac Wiki markup
125
+ * MySQL
126
+ * Nginx config files
127
+ * POV-Ray scenes
128
+ * Ragel
129
+ * Redcode
130
+ * ReST
131
+ * Robot Framework
132
+ * RPM spec files
133
+ * SQL, also MySQL, SQLite
134
+ * Squid configuration
135
+ * TeX
136
+ * tcsh
137
+ * Vim Script
138
+ * Windows batch files
139
+ * XML
140
+ * XSLT
141
+ * YAML
142
+
143
+ ... that's all?
144
+ ---------------
145
+
146
+ Well, why not write your own? Contributing to Pygments is easy and fun. Look
147
+ :doc:`here <docs/lexerdevelopment>` for the docs on lexer development and
148
+ :ref:`here <contribute>` for contact details.
149
+
150
+ Note: the languages listed here are supported in the development version. The
151
+ latest release may lack a few of them.
@@ -0,0 +1,190 @@
1
+ @ECHO OFF
2
+
3
+ REM Command file for Sphinx documentation
4
+
5
+ if "%SPHINXBUILD%" == "" (
6
+ set SPHINXBUILD=sphinx-build
7
+ )
8
+ set BUILDDIR=_build
9
+ set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10
+ set I18NSPHINXOPTS=%SPHINXOPTS% .
11
+ if NOT "%PAPER%" == "" (
12
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13
+ set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
14
+ )
15
+
16
+ if "%1" == "" goto help
17
+
18
+ if "%1" == "help" (
19
+ :help
20
+ echo.Please use `make ^<target^>` where ^<target^> is one of
21
+ echo. html to make standalone HTML files
22
+ echo. dirhtml to make HTML files named index.html in directories
23
+ echo. singlehtml to make a single large HTML file
24
+ echo. pickle to make pickle files
25
+ echo. json to make JSON files
26
+ echo. htmlhelp to make HTML files and a HTML help project
27
+ echo. qthelp to make HTML files and a qthelp project
28
+ echo. devhelp to make HTML files and a Devhelp project
29
+ echo. epub to make an epub
30
+ echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
31
+ echo. text to make text files
32
+ echo. man to make manual pages
33
+ echo. texinfo to make Texinfo files
34
+ echo. gettext to make PO message catalogs
35
+ echo. changes to make an overview over all changed/added/deprecated items
36
+ echo. linkcheck to check all external links for integrity
37
+ echo. doctest to run all doctests embedded in the documentation if enabled
38
+ goto end
39
+ )
40
+
41
+ if "%1" == "clean" (
42
+ for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
43
+ del /q /s %BUILDDIR%\*
44
+ goto end
45
+ )
46
+
47
+ if "%1" == "html" (
48
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
49
+ if errorlevel 1 exit /b 1
50
+ echo.
51
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
52
+ goto end
53
+ )
54
+
55
+ if "%1" == "dirhtml" (
56
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
57
+ if errorlevel 1 exit /b 1
58
+ echo.
59
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
60
+ goto end
61
+ )
62
+
63
+ if "%1" == "singlehtml" (
64
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
65
+ if errorlevel 1 exit /b 1
66
+ echo.
67
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
68
+ goto end
69
+ )
70
+
71
+ if "%1" == "pickle" (
72
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
73
+ if errorlevel 1 exit /b 1
74
+ echo.
75
+ echo.Build finished; now you can process the pickle files.
76
+ goto end
77
+ )
78
+
79
+ if "%1" == "json" (
80
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
81
+ if errorlevel 1 exit /b 1
82
+ echo.
83
+ echo.Build finished; now you can process the JSON files.
84
+ goto end
85
+ )
86
+
87
+ if "%1" == "htmlhelp" (
88
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
89
+ if errorlevel 1 exit /b 1
90
+ echo.
91
+ echo.Build finished; now you can run HTML Help Workshop with the ^
92
+ .hhp project file in %BUILDDIR%/htmlhelp.
93
+ goto end
94
+ )
95
+
96
+ if "%1" == "qthelp" (
97
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
98
+ if errorlevel 1 exit /b 1
99
+ echo.
100
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
101
+ .qhcp project file in %BUILDDIR%/qthelp, like this:
102
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Pygments.qhcp
103
+ echo.To view the help file:
104
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Pygments.ghc
105
+ goto end
106
+ )
107
+
108
+ if "%1" == "devhelp" (
109
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
110
+ if errorlevel 1 exit /b 1
111
+ echo.
112
+ echo.Build finished.
113
+ goto end
114
+ )
115
+
116
+ if "%1" == "epub" (
117
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
118
+ if errorlevel 1 exit /b 1
119
+ echo.
120
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
121
+ goto end
122
+ )
123
+
124
+ if "%1" == "latex" (
125
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
126
+ if errorlevel 1 exit /b 1
127
+ echo.
128
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
129
+ goto end
130
+ )
131
+
132
+ if "%1" == "text" (
133
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
134
+ if errorlevel 1 exit /b 1
135
+ echo.
136
+ echo.Build finished. The text files are in %BUILDDIR%/text.
137
+ goto end
138
+ )
139
+
140
+ if "%1" == "man" (
141
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
142
+ if errorlevel 1 exit /b 1
143
+ echo.
144
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
145
+ goto end
146
+ )
147
+
148
+ if "%1" == "texinfo" (
149
+ %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
150
+ if errorlevel 1 exit /b 1
151
+ echo.
152
+ echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
153
+ goto end
154
+ )
155
+
156
+ if "%1" == "gettext" (
157
+ %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
158
+ if errorlevel 1 exit /b 1
159
+ echo.
160
+ echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
161
+ goto end
162
+ )
163
+
164
+ if "%1" == "changes" (
165
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
166
+ if errorlevel 1 exit /b 1
167
+ echo.
168
+ echo.The overview file is in %BUILDDIR%/changes.
169
+ goto end
170
+ )
171
+
172
+ if "%1" == "linkcheck" (
173
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
174
+ if errorlevel 1 exit /b 1
175
+ echo.
176
+ echo.Link check complete; look for any errors in the above output ^
177
+ or in %BUILDDIR%/linkcheck/output.txt.
178
+ goto end
179
+ )
180
+
181
+ if "%1" == "doctest" (
182
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
183
+ if errorlevel 1 exit /b 1
184
+ echo.
185
+ echo.Testing of doctests in the sources finished, look at the ^
186
+ results in %BUILDDIR%/doctest/output.txt.
187
+ goto end
188
+ )
189
+
190
+ :end