l0bsterssg

node.js static responsive blog post generator
Log | Files | Refs | README

python-repl.js (629B)


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