• Home
  • Raw
  • Download

Lines Matching +full:source +full:- +full:highlight

2 '''Add syntax highlighting to Python source code'''
13 #### Analyze Python Source #################################
23 return lines[srow-1][scol:ecol], end
24 rows = [lines[srow-1][scol:]] + lines[srow: erow-1] + [lines[erow-1][:ecol]]
27 def analyze_python(source): argument
31 lines = source.splitlines(True)
89 'Add syntax highlighting to source code using ANSI escape sequences'
114 '.docstring': '{color: forestgreen; font-style:italic;}',
117 '.definition': '{color: darkorange; font-weight:bold;}',
123 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
127 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
141 'Create a complete HTML page with colorized source code'
184 'Create a complete LaTeX document with colorized source code'
204 description = 'Add syntax highlighting to Python source code',
210 $ ./highlight.py myfile.py
213 $ ./highlight.py -b myfile.py
216 ./highlight.py -s myfile.py
219 $ ./highlight.py -c myfile.py > myfile.html
222 $ ./highlight.py -l myfile.py | pdflatex
227 parser.add_argument('-b', '--browser', action = 'store_true',
229 parser.add_argument('-c', '--complete', action = 'store_true',
231 parser.add_argument('-l', '--latex', action = 'store_true',
233 parser.add_argument('-r', '--raw', action = 'store_true',
235 parser.add_argument('-s', '--section', action = 'store_true',
240 parser.error('The -s/--section option is incompatible with '
241 'the -b/--browser or -c/--complete options')
245 source = f.read() variable
246 classified_text = analyze_python(source)