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

Skip to content

Commit fcb8725

Browse files
committed
Add a --style option to allow specifying an alternate CSS style sheet for
HTML generation; the machinery was there but no option to set it was defined. Simplify some of the path-math since we can assume a recent version of Python.
1 parent d50a187 commit fcb8725

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Doc/tools/mkhowto

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ HTML options:
2020
values: gif (default), png.
2121
--numeric Don't rename the HTML files; just keep node#.html for
2222
the filenames.
23+
--style Specify the CSS file to use for the output (filename,
24+
not a URL).
2325
2426
Other options:
2527
--a4 Format for A4 paper.
@@ -42,8 +44,8 @@ import sys
4244
import tempfile
4345

4446

45-
MYDIR = os.path.normpath(os.path.join(os.getcwd(), sys.path[0]))
46-
TOPDIR = os.path.normpath(os.path.join(MYDIR, os.pardir))
47+
MYDIR = os.path.abspath(sys.path[0])
48+
TOPDIR = os.path.dirname(MYDIR)
4749

4850
ISTFILE = os.path.join(TOPDIR, "texinputs", "python.ist")
4951
NODE2LABEL_SCRIPT = os.path.join(MYDIR, "node2label.pl")
@@ -109,7 +111,7 @@ class Options:
109111
"address=", "a4", "letter",
110112
"link=", "split=", "logging", "debugging",
111113
"keep", "quiet", "runs=", "image-type=",
112-
"about=", "numeric"]
114+
"about=", "numeric", "style="]
113115
+ list(self.ALL_FORMATS))
114116
for opt, arg in opts:
115117
if opt == "--all":
@@ -144,9 +146,11 @@ class Options:
144146
elif opt == "--about":
145147
# always make this absolute:
146148
self.about_file = os.path.normpath(
147-
os.path.join(os.getcwd(), arg))
149+
os.path.abspath(arg))
148150
elif opt == "--numeric":
149151
self.numeric = 1
152+
elif opt == "--style":
153+
self.style_file = os.path.abspath(arg)
150154
#
151155
# Format specifiers:
152156
#

0 commit comments

Comments
 (0)