emacs.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. """
  2. pygments.styles.emacs
  3. ~~~~~~~~~~~~~~~~~~~~~
  4. A highlighting style for Pygments, inspired by Emacs.
  5. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
  6. :license: BSD, see LICENSE for details.
  7. """
  8. from pygments.style import Style
  9. from pygments.token import Keyword, Name, Comment, String, Error, \
  10. Number, Operator, Generic, Whitespace
  11. class EmacsStyle(Style):
  12. """
  13. The default style (inspired by Emacs 22).
  14. """
  15. background_color = "#f8f8f8"
  16. default_style = ""
  17. styles = {
  18. Whitespace: "#bbbbbb",
  19. Comment: "italic #008800",
  20. Comment.Preproc: "noitalic",
  21. Comment.Special: "noitalic bold",
  22. Keyword: "bold #AA22FF",
  23. Keyword.Pseudo: "nobold",
  24. Keyword.Type: "bold #00BB00",
  25. Operator: "#666666",
  26. Operator.Word: "bold #AA22FF",
  27. Name.Builtin: "#AA22FF",
  28. Name.Function: "#00A000",
  29. Name.Class: "#0000FF",
  30. Name.Namespace: "bold #0000FF",
  31. Name.Exception: "bold #D2413A",
  32. Name.Variable: "#B8860B",
  33. Name.Constant: "#880000",
  34. Name.Label: "#A0A000",
  35. Name.Entity: "bold #999999",
  36. Name.Attribute: "#BB4444",
  37. Name.Tag: "bold #008000",
  38. Name.Decorator: "#AA22FF",
  39. String: "#BB4444",
  40. String.Doc: "italic",
  41. String.Interpol: "bold #BB6688",
  42. String.Escape: "bold #BB6622",
  43. String.Regex: "#BB6688",
  44. String.Symbol: "#B8860B",
  45. String.Other: "#008000",
  46. Number: "#666666",
  47. Generic.Heading: "bold #000080",
  48. Generic.Subheading: "bold #800080",
  49. Generic.Deleted: "#A00000",
  50. Generic.Inserted: "#00A000",
  51. Generic.Error: "#FF0000",
  52. Generic.Emph: "italic",
  53. Generic.Strong: "bold",
  54. Generic.Prompt: "bold #000080",
  55. Generic.Output: "#888",
  56. Generic.Traceback: "#04D",
  57. Error: "border:#FF0000"
  58. }