pygments.rb 1.2.1 → 2.2.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 (386) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +13 -0
  3. data/.github/workflows/ci.yml +40 -0
  4. data/.github/workflows/release.yml +24 -0
  5. data/.gitignore +4 -6
  6. data/.rubocop.yml +16 -0
  7. data/CHANGELOG.adoc +137 -0
  8. data/Gemfile +3 -1
  9. data/LICENSE +1 -1
  10. data/README.adoc +159 -0
  11. data/Rakefile +8 -32
  12. data/bench.rb +14 -8
  13. data/lib/pygments.rb +16 -14
  14. data/lib/pygments/lexer.rb +87 -65
  15. data/lib/pygments/mentos.py +23 -110
  16. data/lib/pygments/popen.rb +188 -284
  17. data/lib/pygments/version.rb +2 -2
  18. data/pygments.rb.gemspec +20 -13
  19. data/test/test_pygments.rb +50 -110
  20. data/vendor/pygments-main/{AUTHORS → Pygments-2.8.1.dist-info/AUTHORS} +26 -3
  21. data/vendor/pygments-main/Pygments-2.8.1.dist-info/INSTALLER +1 -0
  22. data/vendor/pygments-main/{LICENSE → Pygments-2.8.1.dist-info/LICENSE} +1 -1
  23. data/vendor/pygments-main/Pygments-2.8.1.dist-info/METADATA +48 -0
  24. data/vendor/pygments-main/Pygments-2.8.1.dist-info/RECORD +494 -0
  25. data/vendor/pygments-main/Pygments-2.8.1.dist-info/REQUESTED +0 -0
  26. data/vendor/pygments-main/Pygments-2.8.1.dist-info/WHEEL +5 -0
  27. data/vendor/pygments-main/Pygments-2.8.1.dist-info/entry_points.txt +3 -0
  28. data/vendor/pygments-main/Pygments-2.8.1.dist-info/top_level.txt +1 -0
  29. data/vendor/pygments-main/bin/pygmentize +8 -0
  30. data/vendor/pygments-main/pygments/__init__.py +6 -12
  31. data/vendor/pygments-main/pygments/__main__.py +17 -0
  32. data/vendor/pygments-main/pygments/cmdline.py +213 -184
  33. data/vendor/pygments-main/pygments/console.py +6 -10
  34. data/vendor/pygments-main/pygments/filter.py +4 -7
  35. data/vendor/pygments-main/pygments/filters/__init__.py +609 -22
  36. data/vendor/pygments-main/pygments/formatter.py +4 -5
  37. data/vendor/pygments-main/pygments/formatters/__init__.py +10 -10
  38. data/vendor/pygments-main/pygments/formatters/_mapping.py +1 -4
  39. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -2
  40. data/vendor/pygments-main/pygments/formatters/html.py +242 -139
  41. data/vendor/pygments-main/pygments/formatters/img.py +91 -50
  42. data/vendor/pygments-main/pygments/formatters/irc.py +39 -40
  43. data/vendor/pygments-main/pygments/formatters/latex.py +62 -33
  44. data/vendor/pygments-main/pygments/formatters/other.py +18 -17
  45. data/vendor/pygments-main/pygments/formatters/rtf.py +29 -30
  46. data/vendor/pygments-main/pygments/formatters/svg.py +40 -5
  47. data/vendor/pygments-main/pygments/formatters/terminal.py +25 -32
  48. data/vendor/pygments-main/pygments/formatters/terminal256.py +45 -14
  49. data/vendor/pygments-main/pygments/lexer.py +47 -44
  50. data/vendor/pygments-main/pygments/lexers/__init__.py +341 -0
  51. data/vendor/pygments-main/pygments/lexers/_asy_builtins.py +1644 -0
  52. data/vendor/pygments-main/pygments/lexers/_cl_builtins.py +231 -0
  53. data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +75 -0
  54. data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1724 -0
  55. data/vendor/pygments-main/pygments/lexers/_lasso_builtins.py +5326 -0
  56. data/vendor/pygments-main/pygments/lexers/_lua_builtins.py +292 -0
  57. data/vendor/pygments-main/pygments/lexers/_mapping.py +554 -0
  58. data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1171 -0
  59. data/vendor/pygments-main/pygments/lexers/_mysql_builtins.py +1281 -0
  60. data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +2600 -0
  61. data/vendor/pygments-main/pygments/lexers/_php_builtins.py +4752 -0
  62. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +677 -0
  63. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3093 -0
  64. data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1160 -0
  65. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +557 -0
  66. data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +457 -0
  67. data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1003 -0
  68. data/vendor/pygments-main/pygments/lexers/_usd_builtins.py +112 -0
  69. data/vendor/pygments-main/pygments/lexers/_vbscript_builtins.py +279 -0
  70. data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1938 -0
  71. data/vendor/pygments-main/pygments/lexers/actionscript.py +244 -0
  72. data/vendor/pygments-main/pygments/lexers/agile.py +23 -0
  73. data/vendor/pygments-main/pygments/lexers/algebra.py +239 -0
  74. data/vendor/pygments-main/pygments/lexers/ambient.py +75 -0
  75. data/vendor/pygments-main/pygments/lexers/amdgpu.py +48 -0
  76. data/vendor/pygments-main/pygments/lexers/ampl.py +86 -0
  77. data/vendor/pygments-main/pygments/lexers/apl.py +100 -0
  78. data/vendor/pygments-main/pygments/lexers/archetype.py +317 -0
  79. data/vendor/pygments-main/pygments/lexers/arrow.py +116 -0
  80. data/vendor/pygments-main/pygments/lexers/asm.py +1004 -0
  81. data/vendor/pygments-main/pygments/lexers/automation.py +379 -0
  82. data/vendor/pygments-main/pygments/lexers/bare.py +103 -0
  83. data/vendor/pygments-main/pygments/lexers/basic.py +661 -0
  84. data/vendor/pygments-main/pygments/lexers/bibtex.py +159 -0
  85. data/vendor/pygments-main/pygments/lexers/boa.py +101 -0
  86. data/vendor/pygments-main/pygments/lexers/business.py +626 -0
  87. data/vendor/pygments-main/pygments/lexers/c_cpp.py +342 -0
  88. data/vendor/pygments-main/pygments/lexers/c_like.py +565 -0
  89. data/vendor/pygments-main/pygments/lexers/capnproto.py +77 -0
  90. data/vendor/pygments-main/pygments/lexers/cddl.py +190 -0
  91. data/vendor/pygments-main/pygments/lexers/chapel.py +111 -0
  92. data/vendor/pygments-main/pygments/lexers/clean.py +178 -0
  93. data/vendor/pygments-main/pygments/lexers/compiled.py +33 -0
  94. data/vendor/pygments-main/pygments/lexers/configs.py +985 -0
  95. data/vendor/pygments-main/pygments/lexers/console.py +113 -0
  96. data/vendor/pygments-main/pygments/lexers/crystal.py +366 -0
  97. data/vendor/pygments-main/pygments/lexers/csound.py +466 -0
  98. data/vendor/pygments-main/pygments/lexers/css.py +694 -0
  99. data/vendor/pygments-main/pygments/lexers/d.py +255 -0
  100. data/vendor/pygments-main/pygments/lexers/dalvik.py +124 -0
  101. data/vendor/pygments-main/pygments/lexers/data.py +697 -0
  102. data/vendor/pygments-main/pygments/lexers/devicetree.py +108 -0
  103. data/vendor/pygments-main/pygments/lexers/diff.py +164 -0
  104. data/vendor/pygments-main/pygments/lexers/dotnet.py +706 -0
  105. data/vendor/pygments-main/pygments/lexers/dsls.py +959 -0
  106. data/vendor/pygments-main/pygments/lexers/dylan.py +286 -0
  107. data/vendor/pygments-main/pygments/lexers/ecl.py +137 -0
  108. data/vendor/pygments-main/pygments/lexers/eiffel.py +64 -0
  109. data/vendor/pygments-main/pygments/lexers/elm.py +120 -0
  110. data/vendor/pygments-main/pygments/lexers/email.py +150 -0
  111. data/vendor/pygments-main/pygments/lexers/erlang.py +529 -0
  112. data/vendor/pygments-main/pygments/lexers/esoteric.py +303 -0
  113. data/vendor/pygments-main/pygments/lexers/ezhil.py +76 -0
  114. data/vendor/pygments-main/pygments/lexers/factor.py +343 -0
  115. data/vendor/pygments-main/pygments/lexers/fantom.py +249 -0
  116. data/vendor/pygments-main/pygments/lexers/felix.py +272 -0
  117. data/vendor/pygments-main/pygments/lexers/floscript.py +82 -0
  118. data/vendor/pygments-main/pygments/lexers/forth.py +177 -0
  119. data/vendor/pygments-main/pygments/lexers/fortran.py +208 -0
  120. data/vendor/pygments-main/pygments/lexers/foxpro.py +427 -0
  121. data/vendor/pygments-main/pygments/lexers/freefem.py +897 -0
  122. data/vendor/pygments-main/pygments/lexers/functional.py +20 -0
  123. data/vendor/pygments-main/pygments/lexers/futhark.py +110 -0
  124. data/vendor/pygments-main/pygments/lexers/gdscript.py +345 -0
  125. data/vendor/pygments-main/pygments/lexers/go.py +100 -0
  126. data/vendor/pygments-main/pygments/lexers/grammar_notation.py +269 -0
  127. data/vendor/pygments-main/pygments/lexers/graph.py +84 -0
  128. data/vendor/pygments-main/pygments/lexers/graphics.py +799 -0
  129. data/vendor/pygments-main/pygments/lexers/graphviz.py +57 -0
  130. data/vendor/pygments-main/pygments/lexers/haskell.py +869 -0
  131. data/vendor/pygments-main/pygments/lexers/haxe.py +935 -0
  132. data/vendor/pygments-main/pygments/lexers/hdl.py +468 -0
  133. data/vendor/pygments-main/pygments/lexers/hexdump.py +102 -0
  134. data/vendor/pygments-main/pygments/lexers/html.py +613 -0
  135. data/vendor/pygments-main/pygments/lexers/idl.py +280 -0
  136. data/vendor/pygments-main/pygments/lexers/igor.py +419 -0
  137. data/vendor/pygments-main/pygments/lexers/inferno.py +95 -0
  138. data/vendor/pygments-main/pygments/lexers/installers.py +321 -0
  139. data/vendor/pygments-main/pygments/lexers/int_fiction.py +1367 -0
  140. data/vendor/pygments-main/pygments/lexers/iolang.py +62 -0
  141. data/vendor/pygments-main/pygments/lexers/j.py +145 -0
  142. data/vendor/pygments-main/pygments/lexers/javascript.py +1536 -0
  143. data/vendor/pygments-main/pygments/lexers/julia.py +330 -0
  144. data/vendor/pygments-main/pygments/lexers/jvm.py +1739 -0
  145. data/vendor/pygments-main/pygments/lexers/lisp.py +2698 -0
  146. data/vendor/pygments-main/pygments/lexers/make.py +205 -0
  147. data/vendor/pygments-main/pygments/lexers/markup.py +762 -0
  148. data/vendor/pygments-main/pygments/lexers/math.py +20 -0
  149. data/vendor/pygments-main/pygments/lexers/matlab.py +3280 -0
  150. data/vendor/pygments-main/pygments/lexers/mime.py +225 -0
  151. data/vendor/pygments-main/pygments/lexers/ml.py +957 -0
  152. data/vendor/pygments-main/pygments/lexers/modeling.py +365 -0
  153. data/vendor/pygments-main/pygments/lexers/modula2.py +1579 -0
  154. data/vendor/pygments-main/pygments/lexers/monte.py +203 -0
  155. data/vendor/pygments-main/pygments/lexers/mosel.py +447 -0
  156. data/vendor/pygments-main/pygments/lexers/ncl.py +893 -0
  157. data/vendor/pygments-main/pygments/lexers/nimrod.py +158 -0
  158. data/vendor/pygments-main/pygments/lexers/nit.py +63 -0
  159. data/vendor/pygments-main/pygments/lexers/nix.py +135 -0
  160. data/vendor/pygments-main/pygments/lexers/oberon.py +120 -0
  161. data/vendor/pygments-main/pygments/lexers/objective.py +503 -0
  162. data/vendor/pygments-main/pygments/lexers/ooc.py +84 -0
  163. data/vendor/pygments-main/pygments/lexers/other.py +40 -0
  164. data/vendor/pygments-main/pygments/lexers/parasail.py +78 -0
  165. data/vendor/pygments-main/pygments/lexers/parsers.py +799 -0
  166. data/vendor/pygments-main/pygments/lexers/pascal.py +643 -0
  167. data/vendor/pygments-main/pygments/lexers/pawn.py +202 -0
  168. data/vendor/pygments-main/pygments/lexers/perl.py +731 -0
  169. data/vendor/pygments-main/pygments/lexers/php.py +320 -0
  170. data/vendor/pygments-main/pygments/lexers/pointless.py +70 -0
  171. data/vendor/pygments-main/pygments/lexers/pony.py +93 -0
  172. data/vendor/pygments-main/pygments/lexers/praat.py +301 -0
  173. data/vendor/pygments-main/pygments/lexers/prolog.py +305 -0
  174. data/vendor/pygments-main/pygments/lexers/promql.py +182 -0
  175. data/vendor/pygments-main/pygments/lexers/python.py +1158 -0
  176. data/vendor/pygments-main/pygments/lexers/qvt.py +151 -0
  177. data/vendor/pygments-main/pygments/lexers/r.py +190 -0
  178. data/vendor/pygments-main/pygments/lexers/rdf.py +462 -0
  179. data/vendor/pygments-main/pygments/lexers/rebol.py +430 -0
  180. data/vendor/pygments-main/pygments/lexers/resource.py +84 -0
  181. data/vendor/pygments-main/pygments/lexers/ride.py +138 -0
  182. data/vendor/pygments-main/pygments/lexers/rnc.py +66 -0
  183. data/vendor/pygments-main/pygments/lexers/roboconf.py +81 -0
  184. data/vendor/pygments-main/pygments/lexers/robotframework.py +551 -0
  185. data/vendor/pygments-main/pygments/lexers/ruby.py +523 -0
  186. data/vendor/pygments-main/pygments/lexers/rust.py +223 -0
  187. data/vendor/pygments-main/pygments/lexers/sas.py +227 -0
  188. data/vendor/pygments-main/pygments/lexers/scdoc.py +82 -0
  189. data/vendor/pygments-main/pygments/lexers/scripting.py +1283 -0
  190. data/vendor/pygments-main/pygments/lexers/sgf.py +60 -0
  191. data/vendor/pygments-main/pygments/lexers/shell.py +909 -0
  192. data/vendor/pygments-main/pygments/lexers/sieve.py +68 -0
  193. data/vendor/pygments-main/pygments/lexers/slash.py +184 -0
  194. data/vendor/pygments-main/pygments/lexers/smalltalk.py +194 -0
  195. data/vendor/pygments-main/pygments/lexers/smv.py +78 -0
  196. data/vendor/pygments-main/pygments/lexers/snobol.py +82 -0
  197. data/vendor/pygments-main/pygments/lexers/solidity.py +91 -0
  198. data/vendor/pygments-main/pygments/lexers/special.py +106 -0
  199. data/vendor/pygments-main/pygments/lexers/sql.py +832 -0
  200. data/vendor/pygments-main/pygments/lexers/stata.py +170 -0
  201. data/vendor/pygments-main/pygments/lexers/supercollider.py +94 -0
  202. data/vendor/pygments-main/pygments/lexers/tcl.py +144 -0
  203. data/vendor/pygments-main/pygments/lexers/templates.py +2263 -0
  204. data/vendor/pygments-main/pygments/lexers/teraterm.py +334 -0
  205. data/vendor/pygments-main/pygments/lexers/testing.py +206 -0
  206. data/vendor/pygments-main/pygments/lexers/text.py +25 -0
  207. data/vendor/pygments-main/pygments/lexers/textedit.py +168 -0
  208. data/vendor/pygments-main/pygments/lexers/textfmts.py +429 -0
  209. data/vendor/pygments-main/pygments/lexers/theorem.py +476 -0
  210. data/vendor/pygments-main/pygments/lexers/tnt.py +262 -0
  211. data/vendor/pygments-main/pygments/lexers/trafficscript.py +53 -0
  212. data/vendor/pygments-main/pygments/lexers/typoscript.py +218 -0
  213. data/vendor/pygments-main/pygments/lexers/unicon.py +411 -0
  214. data/vendor/pygments-main/pygments/lexers/urbi.py +145 -0
  215. data/vendor/pygments-main/pygments/lexers/usd.py +89 -0
  216. data/vendor/pygments-main/pygments/lexers/varnish.py +189 -0
  217. data/vendor/pygments-main/pygments/lexers/verification.py +113 -0
  218. data/vendor/pygments-main/pygments/lexers/web.py +23 -0
  219. data/vendor/pygments-main/pygments/lexers/webidl.py +298 -0
  220. data/vendor/pygments-main/pygments/lexers/webmisc.py +991 -0
  221. data/vendor/pygments-main/pygments/lexers/whiley.py +115 -0
  222. data/vendor/pygments-main/pygments/lexers/x10.py +68 -0
  223. data/vendor/pygments-main/pygments/lexers/xorg.py +36 -0
  224. data/vendor/pygments-main/pygments/lexers/yang.py +103 -0
  225. data/vendor/pygments-main/pygments/lexers/zig.py +123 -0
  226. data/vendor/pygments-main/pygments/modeline.py +1 -2
  227. data/vendor/pygments-main/pygments/plugin.py +4 -3
  228. data/vendor/pygments-main/pygments/regexopt.py +1 -2
  229. data/vendor/pygments-main/pygments/scanner.py +2 -3
  230. data/vendor/pygments-main/pygments/sphinxext.py +2 -5
  231. data/vendor/pygments-main/pygments/style.py +61 -25
  232. data/vendor/pygments-main/pygments/styles/__init__.py +12 -5
  233. data/vendor/pygments-main/pygments/styles/abap.py +1 -2
  234. data/vendor/pygments-main/pygments/styles/algol.py +1 -2
  235. data/vendor/pygments-main/pygments/styles/algol_nu.py +1 -2
  236. data/vendor/pygments-main/pygments/styles/arduino.py +2 -3
  237. data/vendor/pygments-main/pygments/styles/autumn.py +1 -2
  238. data/vendor/pygments-main/pygments/styles/borland.py +1 -2
  239. data/vendor/pygments-main/pygments/styles/bw.py +1 -2
  240. data/vendor/pygments-main/pygments/styles/colorful.py +1 -2
  241. data/vendor/pygments-main/pygments/styles/default.py +1 -2
  242. data/vendor/pygments-main/pygments/styles/emacs.py +1 -2
  243. data/vendor/pygments-main/pygments/styles/friendly.py +1 -2
  244. data/vendor/pygments-main/pygments/styles/fruity.py +1 -2
  245. data/vendor/pygments-main/pygments/styles/igor.py +1 -2
  246. data/vendor/pygments-main/pygments/styles/inkpot.py +66 -0
  247. data/vendor/pygments-main/pygments/styles/lovelace.py +1 -2
  248. data/vendor/pygments-main/pygments/styles/manni.py +1 -2
  249. data/vendor/pygments-main/pygments/styles/material.py +118 -0
  250. data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
  251. data/vendor/pygments-main/pygments/styles/murphy.py +1 -2
  252. data/vendor/pygments-main/pygments/styles/native.py +1 -2
  253. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -2
  254. data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -2
  255. data/vendor/pygments-main/pygments/styles/pastie.py +1 -2
  256. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -2
  257. data/vendor/pygments-main/pygments/styles/rainbow_dash.py +1 -2
  258. data/vendor/pygments-main/pygments/styles/rrt.py +1 -2
  259. data/vendor/pygments-main/pygments/styles/sas.py +1 -2
  260. data/vendor/pygments-main/pygments/styles/solarized.py +136 -0
  261. data/vendor/pygments-main/pygments/styles/stata_dark.py +40 -0
  262. data/vendor/pygments-main/pygments/styles/{stata.py → stata_light.py} +14 -16
  263. data/vendor/pygments-main/pygments/styles/tango.py +1 -2
  264. data/vendor/pygments-main/pygments/styles/trac.py +1 -2
  265. data/vendor/pygments-main/pygments/styles/vim.py +1 -2
  266. data/vendor/pygments-main/pygments/styles/vs.py +1 -2
  267. data/vendor/pygments-main/pygments/styles/xcode.py +1 -2
  268. data/vendor/pygments-main/pygments/styles/zenburn.py +80 -0
  269. data/vendor/pygments-main/pygments/token.py +1 -2
  270. data/vendor/pygments-main/pygments/unistring.py +47 -109
  271. data/vendor/pygments-main/pygments/util.py +16 -96
  272. metadata +81 -139
  273. data/CHANGELOG.md +0 -111
  274. data/README.md +0 -121
  275. data/cache-lexers.rb +0 -8
  276. data/circle.yml +0 -20
  277. data/test/test_data.c +0 -2581
  278. data/test/test_data.py +0 -514
  279. data/test/test_data_generated +0 -2582
  280. data/vendor/custom_lexers/github.py +0 -565
  281. data/vendor/pygments-main/CHANGES +0 -1186
  282. data/vendor/pygments-main/MANIFEST.in +0 -6
  283. data/vendor/pygments-main/Makefile +0 -65
  284. data/vendor/pygments-main/README.rst +0 -39
  285. data/vendor/pygments-main/REVISION +0 -1
  286. data/vendor/pygments-main/TODO +0 -12
  287. data/vendor/pygments-main/doc/Makefile +0 -153
  288. data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
  289. data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
  290. data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
  291. data/vendor/pygments-main/doc/_templates/docssidebar.html +0 -3
  292. data/vendor/pygments-main/doc/_templates/indexsidebar.html +0 -25
  293. data/vendor/pygments-main/doc/_themes/pygments14/layout.html +0 -98
  294. data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
  295. data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
  296. data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
  297. data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
  298. data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
  299. data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +0 -401
  300. data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +0 -15
  301. data/vendor/pygments-main/doc/conf.py +0 -241
  302. data/vendor/pygments-main/doc/docs/api.rst +0 -354
  303. data/vendor/pygments-main/doc/docs/authors.rst +0 -4
  304. data/vendor/pygments-main/doc/docs/changelog.rst +0 -1
  305. data/vendor/pygments-main/doc/docs/cmdline.rst +0 -166
  306. data/vendor/pygments-main/doc/docs/filterdevelopment.rst +0 -71
  307. data/vendor/pygments-main/doc/docs/filters.rst +0 -41
  308. data/vendor/pygments-main/doc/docs/formatterdevelopment.rst +0 -169
  309. data/vendor/pygments-main/doc/docs/formatters.rst +0 -48
  310. data/vendor/pygments-main/doc/docs/index.rst +0 -66
  311. data/vendor/pygments-main/doc/docs/integrate.rst +0 -40
  312. data/vendor/pygments-main/doc/docs/java.rst +0 -70
  313. data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +0 -728
  314. data/vendor/pygments-main/doc/docs/lexers.rst +0 -69
  315. data/vendor/pygments-main/doc/docs/moinmoin.rst +0 -39
  316. data/vendor/pygments-main/doc/docs/plugins.rst +0 -93
  317. data/vendor/pygments-main/doc/docs/quickstart.rst +0 -205
  318. data/vendor/pygments-main/doc/docs/rstdirective.rst +0 -22
  319. data/vendor/pygments-main/doc/docs/styles.rst +0 -201
  320. data/vendor/pygments-main/doc/docs/tokens.rst +0 -372
  321. data/vendor/pygments-main/doc/docs/unicode.rst +0 -58
  322. data/vendor/pygments-main/doc/download.rst +0 -41
  323. data/vendor/pygments-main/doc/faq.rst +0 -139
  324. data/vendor/pygments-main/doc/index.rst +0 -54
  325. data/vendor/pygments-main/doc/languages.rst +0 -154
  326. data/vendor/pygments-main/doc/make.bat +0 -190
  327. data/vendor/pygments-main/doc/pygmentize.1 +0 -94
  328. data/vendor/pygments-main/external/autopygmentize +0 -101
  329. data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +0 -162
  330. data/vendor/pygments-main/external/markdown-processor.py +0 -67
  331. data/vendor/pygments-main/external/moin-parser.py +0 -112
  332. data/vendor/pygments-main/external/pygments.bashcomp +0 -38
  333. data/vendor/pygments-main/external/rst-directive.py +0 -82
  334. data/vendor/pygments-main/pygmentize +0 -8
  335. data/vendor/pygments-main/requirements.txt +0 -5
  336. data/vendor/pygments-main/scripts/check_sources.py +0 -211
  337. data/vendor/pygments-main/scripts/debug_lexer.py +0 -246
  338. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +0 -33
  339. data/vendor/pygments-main/scripts/epydoc.css +0 -280
  340. data/vendor/pygments-main/scripts/get_vimkw.py +0 -74
  341. data/vendor/pygments-main/scripts/pylintrc +0 -301
  342. data/vendor/pygments-main/scripts/vim2pygments.py +0 -935
  343. data/vendor/pygments-main/setup.cfg +0 -10
  344. data/vendor/pygments-main/setup.py +0 -77
  345. data/vendor/pygments-main/tox.ini +0 -7
  346. data/vendor/simplejson/.gitignore +0 -10
  347. data/vendor/simplejson/.travis.yml +0 -5
  348. data/vendor/simplejson/CHANGES.txt +0 -291
  349. data/vendor/simplejson/LICENSE.txt +0 -19
  350. data/vendor/simplejson/MANIFEST.in +0 -5
  351. data/vendor/simplejson/README.rst +0 -19
  352. data/vendor/simplejson/conf.py +0 -179
  353. data/vendor/simplejson/index.rst +0 -628
  354. data/vendor/simplejson/scripts/make_docs.py +0 -18
  355. data/vendor/simplejson/setup.py +0 -104
  356. data/vendor/simplejson/simplejson/__init__.py +0 -510
  357. data/vendor/simplejson/simplejson/_speedups.c +0 -2745
  358. data/vendor/simplejson/simplejson/decoder.py +0 -425
  359. data/vendor/simplejson/simplejson/encoder.py +0 -567
  360. data/vendor/simplejson/simplejson/ordered_dict.py +0 -119
  361. data/vendor/simplejson/simplejson/scanner.py +0 -77
  362. data/vendor/simplejson/simplejson/tests/__init__.py +0 -67
  363. data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +0 -55
  364. data/vendor/simplejson/simplejson/tests/test_check_circular.py +0 -30
  365. data/vendor/simplejson/simplejson/tests/test_decimal.py +0 -66
  366. data/vendor/simplejson/simplejson/tests/test_decode.py +0 -83
  367. data/vendor/simplejson/simplejson/tests/test_default.py +0 -9
  368. data/vendor/simplejson/simplejson/tests/test_dump.py +0 -67
  369. data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +0 -46
  370. data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +0 -32
  371. data/vendor/simplejson/simplejson/tests/test_errors.py +0 -34
  372. data/vendor/simplejson/simplejson/tests/test_fail.py +0 -91
  373. data/vendor/simplejson/simplejson/tests/test_float.py +0 -19
  374. data/vendor/simplejson/simplejson/tests/test_indent.py +0 -86
  375. data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +0 -20
  376. data/vendor/simplejson/simplejson/tests/test_namedtuple.py +0 -121
  377. data/vendor/simplejson/simplejson/tests/test_pass1.py +0 -76
  378. data/vendor/simplejson/simplejson/tests/test_pass2.py +0 -14
  379. data/vendor/simplejson/simplejson/tests/test_pass3.py +0 -20
  380. data/vendor/simplejson/simplejson/tests/test_recursion.py +0 -67
  381. data/vendor/simplejson/simplejson/tests/test_scanstring.py +0 -117
  382. data/vendor/simplejson/simplejson/tests/test_separators.py +0 -42
  383. data/vendor/simplejson/simplejson/tests/test_speedups.py +0 -20
  384. data/vendor/simplejson/simplejson/tests/test_tuple.py +0 -49
  385. data/vendor/simplejson/simplejson/tests/test_unicode.py +0 -109
  386. data/vendor/simplejson/simplejson/tool.py +0 -39
@@ -1,69 +0,0 @@
1
- .. -*- mode: rst -*-
2
-
3
- ================
4
- Available lexers
5
- ================
6
-
7
- This page lists all available builtin lexers and the options they take.
8
-
9
- Currently, **all lexers** support these options:
10
-
11
- `stripnl`
12
- Strip leading and trailing newlines from the input (default: ``True``)
13
-
14
- `stripall`
15
- Strip all leading and trailing whitespace from the input (default:
16
- ``False``).
17
-
18
- `ensurenl`
19
- Make sure that the input ends with a newline (default: ``True``). This
20
- is required for some lexers that consume input linewise.
21
-
22
- .. versionadded:: 1.3
23
-
24
- `tabsize`
25
- If given and greater than 0, expand tabs in the input (default: ``0``).
26
-
27
- `encoding`
28
- If given, must be an encoding name (such as ``"utf-8"``). This encoding
29
- will be used to convert the input string to Unicode (if it is not already
30
- a Unicode string). The default is ``"guess"``.
31
-
32
- If this option is set to ``"guess"``, a simple UTF-8 vs. Latin-1
33
- detection is used, if it is set to ``"chardet"``, the
34
- `chardet library <https://chardet.github.io/>`_ is used to
35
- guess the encoding of the input.
36
-
37
- .. versionadded:: 0.6
38
-
39
-
40
- The "Short Names" field lists the identifiers that can be used with the
41
- `get_lexer_by_name()` function.
42
-
43
- These lexers are builtin and can be imported from `pygments.lexers`:
44
-
45
- .. pygmentsdoc:: lexers
46
-
47
-
48
- Iterating over all lexers
49
- -------------------------
50
-
51
- .. versionadded:: 0.6
52
-
53
- To get all lexers (both the builtin and the plugin ones), you can
54
- use the `get_all_lexers()` function from the `pygments.lexers`
55
- module:
56
-
57
- .. sourcecode:: pycon
58
-
59
- >>> from pygments.lexers import get_all_lexers
60
- >>> i = get_all_lexers()
61
- >>> i.next()
62
- ('Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch'))
63
- >>> i.next()
64
- ('Delphi', ('delphi', 'objectpascal', 'pas', 'pascal'), ('*.pas',), ('text/x-pascal',))
65
- >>> i.next()
66
- ('XML+Ruby', ('xml+erb', 'xml+ruby'), (), ())
67
-
68
- As you can see, the return value is an iterator which yields tuples
69
- in the form ``(name, aliases, filetypes, mimetypes)``.
@@ -1,39 +0,0 @@
1
- .. -*- mode: rst -*-
2
-
3
- ============================
4
- Using Pygments with MoinMoin
5
- ============================
6
-
7
- From Pygments 0.7, the source distribution ships a `Moin`_ parser plugin that
8
- can be used to get Pygments highlighting in Moin wiki pages.
9
-
10
- To use it, copy the file `external/moin-parser.py` from the Pygments
11
- distribution to the `data/plugin/parser` subdirectory of your Moin instance.
12
- Edit the options at the top of the file (currently ``ATTACHMENTS`` and
13
- ``INLINESTYLES``) and rename the file to the name that the parser directive
14
- should have. For example, if you name the file ``code.py``, you can get a
15
- highlighted Python code sample with this Wiki markup::
16
-
17
- {{{
18
- #!code python
19
- [...]
20
- }}}
21
-
22
- where ``python`` is the Pygments name of the lexer to use.
23
-
24
- Additionally, if you set the ``ATTACHMENTS`` option to True, Pygments will also
25
- be called for all attachments for whose filenames there is no other parser
26
- registered.
27
-
28
- You are responsible for including CSS rules that will map the Pygments CSS
29
- classes to colors. You can output a stylesheet file with `pygmentize`, put it
30
- into the `htdocs` directory of your Moin instance and then include it in the
31
- `stylesheets` configuration option in the Moin config, e.g.::
32
-
33
- stylesheets = [('screen', '/htdocs/pygments.css')]
34
-
35
- If you do not want to do that and are willing to accept larger HTML output, you
36
- can set the ``INLINESTYLES`` option to True.
37
-
38
-
39
- .. _Moin: http://moinmoin.wikiwikiweb.de/
@@ -1,93 +0,0 @@
1
- ================
2
- Register Plugins
3
- ================
4
-
5
- If you want to extend Pygments without hacking the sources, but want to
6
- use the lexer/formatter/style/filter lookup functions (`lexers.get_lexer_by_name`
7
- et al.), you can use `setuptools`_ entrypoints to add new lexers, formatters
8
- or styles as if they were in the Pygments core.
9
-
10
- .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
11
-
12
- That means you can use your highlighter modules with the `pygmentize` script,
13
- which relies on the mentioned functions.
14
-
15
-
16
- Entrypoints
17
- ===========
18
-
19
- Here is a list of setuptools entrypoints that Pygments understands:
20
-
21
- `pygments.lexers`
22
-
23
- This entrypoint is used for adding new lexers to the Pygments core.
24
- The name of the entrypoint values doesn't really matter, Pygments extracts
25
- required metadata from the class definition:
26
-
27
- .. sourcecode:: ini
28
-
29
- [pygments.lexers]
30
- yourlexer = yourmodule:YourLexer
31
-
32
- Note that you have to define ``name``, ``aliases`` and ``filename``
33
- attributes so that you can use the highlighter from the command line:
34
-
35
- .. sourcecode:: python
36
-
37
- class YourLexer(...):
38
- name = 'Name Of Your Lexer'
39
- aliases = ['alias']
40
- filenames = ['*.ext']
41
-
42
-
43
- `pygments.formatters`
44
-
45
- You can use this entrypoint to add new formatters to Pygments. The
46
- name of an entrypoint item is the name of the formatter. If you
47
- prefix the name with a slash it's used as a filename pattern:
48
-
49
- .. sourcecode:: ini
50
-
51
- [pygments.formatters]
52
- yourformatter = yourmodule:YourFormatter
53
- /.ext = yourmodule:YourFormatter
54
-
55
-
56
- `pygments.styles`
57
-
58
- To add a new style you can use this entrypoint. The name of the entrypoint
59
- is the name of the style:
60
-
61
- .. sourcecode:: ini
62
-
63
- [pygments.styles]
64
- yourstyle = yourmodule:YourStyle
65
-
66
-
67
- `pygments.filters`
68
-
69
- Use this entrypoint to register a new filter. The name of the
70
- entrypoint is the name of the filter:
71
-
72
- .. sourcecode:: ini
73
-
74
- [pygments.filters]
75
- yourfilter = yourmodule:YourFilter
76
-
77
-
78
- How To Use Entrypoints
79
- ======================
80
-
81
- This documentation doesn't explain how to use those entrypoints because this is
82
- covered in the `setuptools documentation`_. That page should cover everything
83
- you need to write a plugin.
84
-
85
- .. _setuptools documentation: http://peak.telecommunity.com/DevCenter/setuptools
86
-
87
-
88
- Extending The Core
89
- ==================
90
-
91
- If you have written a Pygments plugin that is open source, please inform us
92
- about that. There is a high chance that we'll add it to the Pygments
93
- distribution.
@@ -1,205 +0,0 @@
1
- .. -*- mode: rst -*-
2
-
3
- ===========================
4
- Introduction and Quickstart
5
- ===========================
6
-
7
-
8
- Welcome to Pygments! This document explains the basic concepts and terms and
9
- gives a few examples of how to use the library.
10
-
11
-
12
- Architecture
13
- ============
14
-
15
- There are four types of components that work together highlighting a piece of
16
- code:
17
-
18
- * A **lexer** splits the source into tokens, fragments of the source that
19
- have a token type that determines what the text represents semantically
20
- (e.g., keyword, string, or comment). There is a lexer for every language
21
- or markup format that Pygments supports.
22
- * The token stream can be piped through **filters**, which usually modify
23
- the token types or text fragments, e.g. uppercasing all keywords.
24
- * A **formatter** then takes the token stream and writes it to an output
25
- file, in a format such as HTML, LaTeX or RTF.
26
- * While writing the output, a **style** determines how to highlight all the
27
- different token types. It maps them to attributes like "red and bold".
28
-
29
-
30
- Example
31
- =======
32
-
33
- Here is a small example for highlighting Python code:
34
-
35
- .. sourcecode:: python
36
-
37
- from pygments import highlight
38
- from pygments.lexers import PythonLexer
39
- from pygments.formatters import HtmlFormatter
40
-
41
- code = 'print "Hello World"'
42
- print highlight(code, PythonLexer(), HtmlFormatter())
43
-
44
- which prints something like this:
45
-
46
- .. sourcecode:: html
47
-
48
- <div class="highlight">
49
- <pre><span class="k">print</span> <span class="s">&quot;Hello World&quot;</span></pre>
50
- </div>
51
-
52
- As you can see, Pygments uses CSS classes (by default, but you can change that)
53
- instead of inline styles in order to avoid outputting redundant style information over
54
- and over. A CSS stylesheet that contains all CSS classes possibly used in the output
55
- can be produced by:
56
-
57
- .. sourcecode:: python
58
-
59
- print HtmlFormatter().get_style_defs('.highlight')
60
-
61
- The argument to :func:`get_style_defs` is used as an additional CSS selector:
62
- the output may look like this:
63
-
64
- .. sourcecode:: css
65
-
66
- .highlight .k { color: #AA22FF; font-weight: bold }
67
- .highlight .s { color: #BB4444 }
68
- ...
69
-
70
-
71
- Options
72
- =======
73
-
74
- The :func:`highlight()` function supports a fourth argument called *outfile*, it
75
- must be a file object if given. The formatted output will then be written to
76
- this file instead of being returned as a string.
77
-
78
- Lexers and formatters both support options. They are given to them as keyword
79
- arguments either to the class or to the lookup method:
80
-
81
- .. sourcecode:: python
82
-
83
- from pygments import highlight
84
- from pygments.lexers import get_lexer_by_name
85
- from pygments.formatters import HtmlFormatter
86
-
87
- lexer = get_lexer_by_name("python", stripall=True)
88
- formatter = HtmlFormatter(linenos=True, cssclass="source")
89
- result = highlight(code, lexer, formatter)
90
-
91
- This makes the lexer strip all leading and trailing whitespace from the input
92
- (`stripall` option), lets the formatter output line numbers (`linenos` option),
93
- and sets the wrapping ``<div>``'s class to ``source`` (instead of
94
- ``highlight``).
95
-
96
- Important options include:
97
-
98
- `encoding` : for lexers and formatters
99
- Since Pygments uses Unicode strings internally, this determines which
100
- encoding will be used to convert to or from byte strings.
101
- `style` : for formatters
102
- The name of the style to use when writing the output.
103
-
104
-
105
- For an overview of builtin lexers and formatters and their options, visit the
106
- :doc:`lexer <lexers>` and :doc:`formatters <formatters>` lists.
107
-
108
- For a documentation on filters, see :doc:`this page <filters>`.
109
-
110
-
111
- Lexer and formatter lookup
112
- ==========================
113
-
114
- If you want to lookup a built-in lexer by its alias or a filename, you can use
115
- one of the following methods:
116
-
117
- .. sourcecode:: pycon
118
-
119
- >>> from pygments.lexers import (get_lexer_by_name,
120
- ... get_lexer_for_filename, get_lexer_for_mimetype)
121
-
122
- >>> get_lexer_by_name('python')
123
- <pygments.lexers.PythonLexer>
124
-
125
- >>> get_lexer_for_filename('spam.rb')
126
- <pygments.lexers.RubyLexer>
127
-
128
- >>> get_lexer_for_mimetype('text/x-perl')
129
- <pygments.lexers.PerlLexer>
130
-
131
- All these functions accept keyword arguments; they will be passed to the lexer
132
- as options.
133
-
134
- A similar API is available for formatters: use :func:`.get_formatter_by_name()`
135
- and :func:`.get_formatter_for_filename()` from the :mod:`pygments.formatters`
136
- module for this purpose.
137
-
138
-
139
- Guessing lexers
140
- ===============
141
-
142
- If you don't know the content of the file, or you want to highlight a file
143
- whose extension is ambiguous, such as ``.html`` (which could contain plain HTML
144
- or some template tags), use these functions:
145
-
146
- .. sourcecode:: pycon
147
-
148
- >>> from pygments.lexers import guess_lexer, guess_lexer_for_filename
149
-
150
- >>> guess_lexer('#!/usr/bin/python\nprint "Hello World!"')
151
- <pygments.lexers.PythonLexer>
152
-
153
- >>> guess_lexer_for_filename('test.py', 'print "Hello World!"')
154
- <pygments.lexers.PythonLexer>
155
-
156
- :func:`.guess_lexer()` passes the given content to the lexer classes'
157
- :meth:`analyse_text()` method and returns the one for which it returns the
158
- highest number.
159
-
160
- All lexers have two different filename pattern lists: the primary and the
161
- secondary one. The :func:`.get_lexer_for_filename()` function only uses the
162
- primary list, whose entries are supposed to be unique among all lexers.
163
- :func:`.guess_lexer_for_filename()`, however, will first loop through all lexers
164
- and look at the primary and secondary filename patterns if the filename matches.
165
- If only one lexer matches, it is returned, else the guessing mechanism of
166
- :func:`.guess_lexer()` is used with the matching lexers.
167
-
168
- As usual, keyword arguments to these functions are given to the created lexer
169
- as options.
170
-
171
-
172
- Command line usage
173
- ==================
174
-
175
- You can use Pygments from the command line, using the :program:`pygmentize`
176
- script::
177
-
178
- $ pygmentize test.py
179
-
180
- will highlight the Python file test.py using ANSI escape sequences
181
- (a.k.a. terminal colors) and print the result to standard output.
182
-
183
- To output HTML, use the ``-f`` option::
184
-
185
- $ pygmentize -f html -o test.html test.py
186
-
187
- to write an HTML-highlighted version of test.py to the file test.html.
188
- Note that it will only be a snippet of HTML, if you want a full HTML document,
189
- use the "full" option::
190
-
191
- $ pygmentize -f html -O full -o test.html test.py
192
-
193
- This will produce a full HTML document with included stylesheet.
194
-
195
- A style can be selected with ``-O style=<name>``.
196
-
197
- If you need a stylesheet for an existing HTML file using Pygments CSS classes,
198
- it can be created with::
199
-
200
- $ pygmentize -S default -f html > style.css
201
-
202
- where ``default`` is the style name.
203
-
204
- More options and tricks and be found in the :doc:`command line reference
205
- <cmdline>`.
@@ -1,22 +0,0 @@
1
- .. -*- mode: rst -*-
2
-
3
- ================================
4
- Using Pygments in ReST documents
5
- ================================
6
-
7
- Many Python people use `ReST`_ for documentation their sourcecode, programs,
8
- scripts et cetera. This also means that documentation often includes sourcecode
9
- samples or snippets.
10
-
11
- You can easily enable Pygments support for your ReST texts using a custom
12
- directive -- this is also how this documentation displays source code.
13
-
14
- From Pygments 0.9, the directive is shipped in the distribution as
15
- `external/rst-directive.py`. You can copy and adapt this code to your liking.
16
-
17
- .. removed -- too confusing
18
- *Loosely related note:* The ReST lexer now recognizes ``.. sourcecode::`` and
19
- ``.. code::`` directives and highlights the contents in the specified language
20
- if the `handlecodeblocks` option is true.
21
-
22
- .. _ReST: http://docutils.sf.net/rst.html
@@ -1,201 +0,0 @@
1
- .. -*- mode: rst -*-
2
-
3
- ======
4
- Styles
5
- ======
6
-
7
- Pygments comes with some builtin styles that work for both the HTML and
8
- LaTeX formatter.
9
-
10
- The builtin styles can be looked up with the `get_style_by_name` function:
11
-
12
- .. sourcecode:: pycon
13
-
14
- >>> from pygments.styles import get_style_by_name
15
- >>> get_style_by_name('colorful')
16
- <class 'pygments.styles.colorful.ColorfulStyle'>
17
-
18
- You can pass a instance of a `Style` class to a formatter as the `style`
19
- option in form of a string:
20
-
21
- .. sourcecode:: pycon
22
-
23
- >>> from pygments.styles import get_style_by_name
24
- >>> from pygments.formatters import HtmlFormatter
25
- >>> HtmlFormatter(style='colorful').style
26
- <class 'pygments.styles.colorful.ColorfulStyle'>
27
-
28
- Or you can also import your own style (which must be a subclass of
29
- `pygments.style.Style`) and pass it to the formatter:
30
-
31
- .. sourcecode:: pycon
32
-
33
- >>> from yourapp.yourmodule import YourStyle
34
- >>> from pygments.formatters import HtmlFormatter
35
- >>> HtmlFormatter(style=YourStyle).style
36
- <class 'yourapp.yourmodule.YourStyle'>
37
-
38
-
39
- Creating Own Styles
40
- ===================
41
-
42
- So, how to create a style? All you have to do is to subclass `Style` and
43
- define some styles:
44
-
45
- .. sourcecode:: python
46
-
47
- from pygments.style import Style
48
- from pygments.token import Keyword, Name, Comment, String, Error, \
49
- Number, Operator, Generic
50
-
51
- class YourStyle(Style):
52
- default_style = ""
53
- styles = {
54
- Comment: 'italic #888',
55
- Keyword: 'bold #005',
56
- Name: '#f00',
57
- Name.Function: '#0f0',
58
- Name.Class: 'bold #0f0',
59
- String: 'bg:#eee #111'
60
- }
61
-
62
- That's it. There are just a few rules. When you define a style for `Name`
63
- the style automatically also affects `Name.Function` and so on. If you
64
- defined ``'bold'`` and you don't want boldface for a subtoken use ``'nobold'``.
65
-
66
- (Philosophy: the styles aren't written in CSS syntax since this way
67
- they can be used for a variety of formatters.)
68
-
69
- `default_style` is the style inherited by all token types.
70
-
71
- To make the style usable for Pygments, you must
72
-
73
- * either register it as a plugin (see :doc:`the plugin docs <plugins>`)
74
- * or drop it into the `styles` subpackage of your Pygments distribution one style
75
- class per style, where the file name is the style name and the class name is
76
- `StylenameClass`. For example, if your style should be called
77
- ``"mondrian"``, name the class `MondrianStyle`, put it into the file
78
- ``mondrian.py`` and this file into the ``pygments.styles`` subpackage
79
- directory.
80
-
81
-
82
- Style Rules
83
- ===========
84
-
85
- Here a small overview of all allowed styles:
86
-
87
- ``bold``
88
- render text as bold
89
- ``nobold``
90
- don't render text as bold (to prevent subtokens being highlighted bold)
91
- ``italic``
92
- render text italic
93
- ``noitalic``
94
- don't render text as italic
95
- ``underline``
96
- render text underlined
97
- ``nounderline``
98
- don't render text underlined
99
- ``bg:``
100
- transparent background
101
- ``bg:#000000``
102
- background color (black)
103
- ``border:``
104
- no border
105
- ``border:#ffffff``
106
- border color (white)
107
- ``#ff0000``
108
- text color (red)
109
- ``noinherit``
110
- don't inherit styles from supertoken
111
-
112
- Note that there may not be a space between ``bg:`` and the color value
113
- since the style definition string is split at whitespace.
114
- Also, using named colors is not allowed since the supported color names
115
- vary for different formatters.
116
-
117
- Furthermore, not all lexers might support every style.
118
-
119
-
120
- Builtin Styles
121
- ==============
122
-
123
- Pygments ships some builtin styles which are maintained by the Pygments team.
124
-
125
- To get a list of known styles you can use this snippet:
126
-
127
- .. sourcecode:: pycon
128
-
129
- >>> from pygments.styles import STYLE_MAP
130
- >>> STYLE_MAP.keys()
131
- ['default', 'emacs', 'friendly', 'colorful']
132
-
133
-
134
- Getting a list of available styles
135
- ==================================
136
-
137
- .. versionadded:: 0.6
138
-
139
- Because it could be that a plugin registered a style, there is
140
- a way to iterate over all styles:
141
-
142
- .. sourcecode:: pycon
143
-
144
- >>> from pygments.styles import get_all_styles
145
- >>> styles = list(get_all_styles())
146
-
147
-
148
- .. _AnsiTerminalStyle:
149
-
150
- Terminal Styles
151
- ===============
152
-
153
- .. versionadded:: 2.2
154
-
155
- Custom styles used with the 256-color terminal formatter can also map colors to
156
- use the 8 default ANSI colors. To do so, use ``#ansigreen``, ``#ansired`` or
157
- any other colors defined in :attr:`pygments.style.ansicolors`. Foreground ANSI
158
- colors will be mapped to the corresponding `escape codes 30 to 37
159
- <https://en.wikipedia.org/wiki/ANSI_escape_code#Colors>`_ thus respecting any
160
- custom color mapping and themes provided by many terminal emulators. Light
161
- variants are treated as foreground color with and an added bold flag.
162
- ``bg:#ansi<color>`` will also be respected, except the light variant will be the
163
- same shade as their dark variant.
164
-
165
- See the following example where the color of the string ``"hello world"`` is
166
- governed by the escape sequence ``\x1b[34;01m`` (Ansi Blue, Bold, 41 being red
167
- background) instead of an extended foreground & background color.
168
-
169
- .. sourcecode:: pycon
170
-
171
- >>> from pygments import highlight
172
- >>> from pygments.style import Style
173
- >>> from pygments.token import Token
174
- >>> from pygments.lexers import Python3Lexer
175
- >>> from pygments.formatters import Terminal256Formatter
176
-
177
- >>> class MyStyle(Style):
178
- styles = {
179
- Token.String: '#ansiblue bg:#ansired',
180
- }
181
-
182
- >>> code = 'print("Hello World")'
183
- >>> result = highlight(code, Python3Lexer(), Terminal256Formatter(style=MyStyle))
184
- >>> print(result.encode())
185
- b'\x1b[34;41;01m"\x1b[39;49;00m\x1b[34;41;01mHello World\x1b[39;49;00m\x1b[34;41;01m"\x1b[39;49;00m'
186
-
187
- Colors specified using ``#ansi*`` are converted to a default set of RGB colors
188
- when used with formatters other than the terminal-256 formatter.
189
-
190
- By definition of ANSI, the following colors are considered "light" colors, and
191
- will be rendered by most terminals as bold:
192
-
193
- - "darkgray", "red", "green", "yellow", "blue", "fuchsia", "turquoise", "white"
194
-
195
- The following are considered "dark" colors and will be rendered as non-bold:
196
-
197
- - "black", "darkred", "darkgreen", "brown", "darkblue", "purple", "teal",
198
- "lightgray"
199
-
200
- Exact behavior might depends on the terminal emulator you are using, and its
201
- settings.