File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 3030
3131import argparse
3232import os
33+ import platform
3334import posixpath
3435import shutil
3536import sys
3637import textwrap
3738import webbrowser
3839
40+ if platform .system () == 'Windows' :
41+ python = 'py'
42+ else :
43+ python = 'python3'
44+
3945try :
4046 import mistune
4147except ImportError :
42- import platform
43- if platform .system () == 'Windows' :
44- python = 'py'
45- else :
46- python = 'python3'
4748 print ("mistune isn't installed." , file = sys .stderr )
4849 print ("You can install it by running this command on a terminal or " )
4950 print ("command prompt:" )
5051 print ()
51- print (" %s -m pip install --user mistune" % python )
52+ print (" %s -m pip install mistune" % python )
5253 sys .exit (1 )
5354
5455try :
@@ -112,7 +113,7 @@ def fix_filename(filename):
112113 return filename
113114
114115
115- class TutorialRenderer (mistune .Renderer ):
116+ class TutorialRenderer (mistune .HTMLRenderer ):
116117
117118 def __init__ (self , pygments_style ):
118119 super ().__init__ ()
@@ -226,8 +227,7 @@ def main():
226227 if pygments is None :
227228 print ("Pygments isn't installed. You can install it like this:" )
228229 print ()
229- print (">>> import pip" )
230- print (">>> pip.main(['install', '--user', 'pygments'])" )
230+ print (" %s -m pip install pygments" % python )
231231 print ()
232232 print ("You can also continue without Pygments, but the code examples" )
233233 print ("will not be colored." )
You can’t perform that action at this time.
0 commit comments