python-repl.js 687 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. Language: Python REPL
  3. Requires: python.js
  4. Author: Josh Goebel <hello@joshgoebel.com>
  5. Category: common
  6. */
  7. function pythonRepl(hljs) {
  8. return {
  9. aliases: [ 'pycon' ],
  10. contains: [
  11. {
  12. className: 'meta',
  13. starts: {
  14. // a space separates the REPL prefix from the actual code
  15. // this is purely for cleaner HTML output
  16. end: / |$/,
  17. starts: {
  18. end: '$',
  19. subLanguage: 'python'
  20. }
  21. },
  22. variants: [
  23. {
  24. begin: /^>>>(?=[ ]|$)/
  25. },
  26. {
  27. begin: /^\.\.\.(?=[ ]|$)/
  28. }
  29. ]
  30. }
  31. ]
  32. };
  33. }
  34. module.exports = pythonRepl;