algol_nu.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. """
  2. pygments.styles.algol_nu
  3. ~~~~~~~~~~~~~~~~~~~~~~~~
  4. Algol publication style without underlining of keywords.
  5. This style renders source code for publication of algorithms in
  6. scientific papers and academic texts, where its format is frequently used.
  7. It is based on the style of the revised Algol-60 language report[1].
  8. o No colours, only black, white and shades of grey are used.
  9. o Keywords are rendered in lowercase boldface.
  10. o Builtins are rendered in lowercase boldface italic.
  11. o Docstrings and pragmas are rendered in dark grey boldface.
  12. o Library identifiers are rendered in dark grey boldface italic.
  13. o Comments are rendered in grey italic.
  14. To render keywords with underlining, refer to the `Algol` style.
  15. For lowercase conversion of keywords and builtins in languages where
  16. these are not or might not be lowercase, a supporting lexer is required.
  17. The Algol and Modula-2 lexers automatically convert to lowercase whenever
  18. this style is selected.
  19. [1] `Revised Report on the Algorithmic Language Algol-60 <http://www.masswerk.at/algol60/report.htm>`
  20. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
  21. :license: BSD, see LICENSE for details.
  22. """
  23. from pygments.style import Style
  24. from pygments.token import Keyword, Name, Comment, String, Error, Operator
  25. class Algol_NuStyle(Style):
  26. background_color = "#ffffff"
  27. default_style = ""
  28. styles = {
  29. Comment: "italic #888",
  30. Comment.Preproc: "bold noitalic #888",
  31. Comment.Special: "bold noitalic #888",
  32. Keyword: "bold",
  33. Keyword.Declaration: "italic",
  34. Name.Builtin: "bold italic",
  35. Name.Builtin.Pseudo: "bold italic",
  36. Name.Namespace: "bold italic #666",
  37. Name.Class: "bold italic #666",
  38. Name.Function: "bold italic #666",
  39. Name.Variable: "bold italic #666",
  40. Name.Constant: "bold italic #666",
  41. Operator.Word: "bold",
  42. String: "italic #666",
  43. Error: "border:#FF0000"
  44. }