You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
687 B
37 lines
687 B
4 years ago
|
/*
|
||
|
Language: Python REPL
|
||
|
Requires: python.js
|
||
|
Author: Josh Goebel <hello@joshgoebel.com>
|
||
|
Category: common
|
||
|
*/
|
||
|
|
||
|
function pythonRepl(hljs) {
|
||
|
return {
|
||
|
aliases: [ 'pycon' ],
|
||
|
contains: [
|
||
|
{
|
||
|
className: 'meta',
|
||
|
starts: {
|
||
|
// a space separates the REPL prefix from the actual code
|
||
|
// this is purely for cleaner HTML output
|
||
|
end: / |$/,
|
||
|
starts: {
|
||
|
end: '$',
|
||
|
subLanguage: 'python'
|
||
|
}
|
||
|
},
|
||
|
variants: [
|
||
|
{
|
||
|
begin: /^>>>(?=[ ]|$)/
|
||
|
},
|
||
|
{
|
||
|
begin: /^\.\.\.(?=[ ]|$)/
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
};
|
||
|
}
|
||
|
|
||
|
module.exports = pythonRepl;
|