python-repl.js 629 B

12345678910111213141516171819202122232425262728293031
  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: '$', subLanguage: 'python'
  19. }
  20. },
  21. variants: [
  22. { begin: /^>>>(?=[ ]|$)/ },
  23. { begin: /^\.\.\.(?=[ ]|$)/ }
  24. ]
  25. },
  26. ]
  27. }
  28. }
  29. module.exports = pythonRepl;