mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
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.
This commit is contained in:
parent
d50a1877ee
commit
fcb8725de5
1 changed files with 8 additions and 4 deletions
|
|
@ -20,6 +20,8 @@ HTML options:
|
||||||
values: gif (default), png.
|
values: gif (default), png.
|
||||||
--numeric Don't rename the HTML files; just keep node#.html for
|
--numeric Don't rename the HTML files; just keep node#.html for
|
||||||
the filenames.
|
the filenames.
|
||||||
|
--style Specify the CSS file to use for the output (filename,
|
||||||
|
not a URL).
|
||||||
|
|
||||||
Other options:
|
Other options:
|
||||||
--a4 Format for A4 paper.
|
--a4 Format for A4 paper.
|
||||||
|
|
@ -42,8 +44,8 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
|
||||||
MYDIR = os.path.normpath(os.path.join(os.getcwd(), sys.path[0]))
|
MYDIR = os.path.abspath(sys.path[0])
|
||||||
TOPDIR = os.path.normpath(os.path.join(MYDIR, os.pardir))
|
TOPDIR = os.path.dirname(MYDIR)
|
||||||
|
|
||||||
ISTFILE = os.path.join(TOPDIR, "texinputs", "python.ist")
|
ISTFILE = os.path.join(TOPDIR, "texinputs", "python.ist")
|
||||||
NODE2LABEL_SCRIPT = os.path.join(MYDIR, "node2label.pl")
|
NODE2LABEL_SCRIPT = os.path.join(MYDIR, "node2label.pl")
|
||||||
|
|
@ -109,7 +111,7 @@ class Options:
|
||||||
"address=", "a4", "letter",
|
"address=", "a4", "letter",
|
||||||
"link=", "split=", "logging", "debugging",
|
"link=", "split=", "logging", "debugging",
|
||||||
"keep", "quiet", "runs=", "image-type=",
|
"keep", "quiet", "runs=", "image-type=",
|
||||||
"about=", "numeric"]
|
"about=", "numeric", "style="]
|
||||||
+ list(self.ALL_FORMATS))
|
+ list(self.ALL_FORMATS))
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if opt == "--all":
|
if opt == "--all":
|
||||||
|
|
@ -144,9 +146,11 @@ class Options:
|
||||||
elif opt == "--about":
|
elif opt == "--about":
|
||||||
# always make this absolute:
|
# always make this absolute:
|
||||||
self.about_file = os.path.normpath(
|
self.about_file = os.path.normpath(
|
||||||
os.path.join(os.getcwd(), arg))
|
os.path.abspath(arg))
|
||||||
elif opt == "--numeric":
|
elif opt == "--numeric":
|
||||||
self.numeric = 1
|
self.numeric = 1
|
||||||
|
elif opt == "--style":
|
||||||
|
self.style_file = os.path.abspath(arg)
|
||||||
#
|
#
|
||||||
# Format specifiers:
|
# Format specifiers:
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue