Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1bd0fc

Browse files
committed
Fix make-html.py
1 parent 0e00c85 commit e1bd0fc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

make-html.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,26 @@
3030

3131
import argparse
3232
import os
33+
import platform
3334
import posixpath
3435
import shutil
3536
import sys
3637
import textwrap
3738
import webbrowser
3839

40+
if platform.system() == 'Windows':
41+
python = 'py'
42+
else:
43+
python = 'python3'
44+
3945
try:
4046
import mistune
4147
except 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

5455
try:
@@ -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.")

0 commit comments

Comments
 (0)