File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
_theme/_exts/symfonycom/sphinx Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ from pygments .lexer import RegexLexer , bygroups , using
2
+ from pygments .token import *
3
+ from pygments .lexers .shell import BashLexer , BatchLexer
4
+
5
+ class TerminalLexer (RegexLexer ):
6
+ name = 'Terminal'
7
+ aliases = ['terminal' ]
8
+ filenames = []
9
+
10
+ tokens = {
11
+ 'root' : [
12
+ ('^\$' , Generic .Prompt , 'bash-prompt' ),
13
+ ('^[^\n >]+>' , Generic .Prompt , 'dos-prompt' ),
14
+ ('^#.+$' , Comment .Single ),
15
+ ('^.+$' , Generic .Output ),
16
+ ],
17
+ 'bash-prompt' : [
18
+ ('(.+)$' , bygroups (using (BashLexer )), '#pop' )
19
+ ],
20
+ 'dos-prompt' : [
21
+ ('(.+)$' , bygroups (using (BatchLexer )), '#pop' )
22
+ ],
23
+ }
Original file line number Diff line number Diff line change 24
24
from pygments .lexers .special import TextLexer
25
25
from pygments .lexers .text import RstLexer
26
26
from pygments .lexers .web import PhpLexer
27
+ from symfonycom .sphinx .lexer import TerminalLexer
27
28
28
29
# -- General configuration -----------------------------------------------------
29
30
108
109
lexers ['rst' ] = RstLexer ()
109
110
lexers ['varnish3' ] = CLexer ()
110
111
lexers ['varnish4' ] = CLexer ()
112
+ lexers ['terminal' ] = TerminalLexer ()
111
113
112
114
config_block = {
113
115
'markdown' : 'Markdown' ,
You can’t perform that action at this time.
0 commit comments