python-repl.js 655 B

1234567891011121314151617181920212223242526272829303132
  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.prompt',
  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. { begin: /^>>>(?=[ ]|$)/ },
  24. { begin: /^\.\.\.(?=[ ]|$)/ }
  25. ]
  26. }
  27. ]
  28. };
  29. }
  30. export { pythonRepl as default };