emacs.py 2.4 KB

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