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-2023 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. styles = {
  17. Whitespace: "#bbbbbb",
  18. Comment: "italic #008800",
  19. Comment.Preproc: "noitalic",
  20. Comment.Special: "noitalic bold",
  21. Keyword: "bold #AA22FF",
  22. Keyword.Pseudo: "nobold",
  23. Keyword.Type: "bold #00BB00",
  24. Operator: "#666666",
  25. Operator.Word: "bold #AA22FF",
  26. Name.Builtin: "#AA22FF",
  27. Name.Function: "#00A000",
  28. Name.Class: "#0000FF",
  29. Name.Namespace: "bold #0000FF",
  30. Name.Exception: "bold #D2413A",
  31. Name.Variable: "#B8860B",
  32. Name.Constant: "#880000",
  33. Name.Label: "#A0A000",
  34. Name.Entity: "bold #999999",
  35. Name.Attribute: "#BB4444",
  36. Name.Tag: "bold #008000",
  37. Name.Decorator: "#AA22FF",
  38. String: "#BB4444",
  39. String.Doc: "italic",
  40. String.Interpol: "bold #BB6688",
  41. String.Escape: "bold #BB6622",
  42. String.Regex: "#BB6688",
  43. String.Symbol: "#B8860B",
  44. String.Other: "#008000",
  45. Number: "#666666",
  46. Generic.Heading: "bold #000080",
  47. Generic.Subheading: "bold #800080",
  48. Generic.Deleted: "#A00000",
  49. Generic.Inserted: "#00A000",
  50. Generic.Error: "#FF0000",
  51. Generic.Emph: "italic",
  52. Generic.Strong: "bold",
  53. Generic.EmphStrong: "bold italic",
  54. Generic.Prompt: "bold #000080",
  55. Generic.Output: "#888",
  56. Generic.Traceback: "#04D",
  57. Error: "border:#FF0000"
  58. }