classyext.py 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # flasky extensions. flasky pygments style based on tango style
  2. from pygments.style import Style
  3. from pygments.token import Keyword, Name, Comment, String, Error, \
  4. Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
  5. class ClassyStyle(Style):
  6. background_color = "#f8f8f8"
  7. default_style = ""
  8. styles = {
  9. # No corresponding class for the following:
  10. #Text: "", # class: ''
  11. Whitespace: "underline #f8f8f8", # class: 'w'
  12. Error: "#a40000 border:#ef2929", # class: 'err'
  13. Other: "#000000", # class 'x'
  14. Comment: "italic #8f5902", # class: 'c'
  15. Comment.Preproc: "noitalic", # class: 'cp'
  16. Keyword: "bold #004461", # class: 'k'
  17. Keyword.Constant: "bold #004461", # class: 'kc'
  18. Keyword.Declaration: "bold #004461", # class: 'kd'
  19. Keyword.Namespace: "bold #004461", # class: 'kn'
  20. Keyword.Pseudo: "bold #004461", # class: 'kp'
  21. Keyword.Reserved: "bold #004461", # class: 'kr'
  22. Keyword.Type: "bold #004461", # class: 'kt'
  23. Operator: "#582800", # class: 'o'
  24. Operator.Word: "bold #004461", # class: 'ow' - like keywords
  25. Punctuation: "bold #000000", # class: 'p'
  26. # because special names such as Name.Class, Name.Function, etc.
  27. # are not recognized as such later in the parsing, we choose them
  28. # to look the same as ordinary variables.
  29. Name: "#000000", # class: 'n'
  30. Name.Attribute: "#c4a000", # class: 'na' - to be revised
  31. Name.Builtin: "#004461", # class: 'nb'
  32. Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
  33. Name.Class: "#000000", # class: 'nc' - to be revised
  34. Name.Constant: "#000000", # class: 'no' - to be revised
  35. Name.Decorator: "#888", # class: 'nd' - to be revised
  36. Name.Entity: "#ce5c00", # class: 'ni'
  37. Name.Exception: "bold #cc0000", # class: 'ne'
  38. Name.Function: "#000000", # class: 'nf'
  39. Name.Property: "#000000", # class: 'py'
  40. Name.Label: "#f57900", # class: 'nl'
  41. Name.Namespace: "#000000", # class: 'nn' - to be revised
  42. Name.Other: "#000000", # class: 'nx'
  43. Name.Tag: "bold #004461", # class: 'nt' - like a keyword
  44. Name.Variable: "#000000", # class: 'nv' - to be revised
  45. Name.Variable.Class: "#000000", # class: 'vc' - to be revised
  46. Name.Variable.Global: "#000000", # class: 'vg' - to be revised
  47. Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
  48. Number: "#990000", # class: 'm'
  49. Literal: "#000000", # class: 'l'
  50. Literal.Date: "#000000", # class: 'ld'
  51. String: "#4e9a06", # class: 's'
  52. String.Backtick: "#4e9a06", # class: 'sb'
  53. String.Char: "#4e9a06", # class: 'sc'
  54. String.Doc: "italic #8f5902", # class: 'sd' - like a comment
  55. String.Double: "#4e9a06", # class: 's2'
  56. String.Escape: "#4e9a06", # class: 'se'
  57. String.Heredoc: "#4e9a06", # class: 'sh'
  58. String.Interpol: "#4e9a06", # class: 'si'
  59. String.Other: "#4e9a06", # class: 'sx'
  60. String.Regex: "#4e9a06", # class: 'sr'
  61. String.Single: "#4e9a06", # class: 's1'
  62. String.Symbol: "#4e9a06", # class: 'ss'
  63. Generic: "#000000", # class: 'g'
  64. Generic.Deleted: "#a40000", # class: 'gd'
  65. Generic.Emph: "italic #000000", # class: 'ge'
  66. Generic.Error: "#ef2929", # class: 'gr'
  67. Generic.Heading: "bold #000080", # class: 'gh'
  68. Generic.Inserted: "#00A000", # class: 'gi'
  69. Generic.Output: "#888", # class: 'go'
  70. Generic.Prompt: "#745334", # class: 'gp'
  71. Generic.Strong: "bold #000000", # class: 'gs'
  72. Generic.Subheading: "bold #800080", # class: 'gu'
  73. Generic.Traceback: "bold #a40000", # class: 'gt'
  74. }