@@ -5,6 +5,7 @@ import glob
6import os.path as path
6import os.path as path
10BAT_OPTIONS = [
11BAT_OPTIONS = [
@@ -16,7 +17,7 @@ BAT_OPTIONS = [
19−def create_highlighted_versions():
20+def create_highlighted_versions(output_basepath):
20 root = os.path.dirname(os.path.abspath(__file__))
21 root = os.path.dirname(os.path.abspath(__file__))
22 for source in glob.glob(path.join(root, "source", "*", "*")):
23 for source in glob.glob(path.join(root, "source", "*", "*")):
@@ -28,7 +29,7 @@ def create_highlighted_versions():
28 source_dirname = path.basename(path.dirname(source))
29 source_dirname = path.basename(path.dirname(source))
29 source_filename = path.basename(source)
30 source_filename = path.basename(source)
31− output_dir = path.join(root, "highlighted", source_dirname)
32+ output_dir = path.join(output_basepath, source_dirname)
32 output_path = path.join(output_dir, source_filename)
33 output_path = path.join(output_dir, source_filename)
34 os.makedirs(output_dir, exist_ok=True)
35 os.makedirs(output_dir, exist_ok=True)
@@ -55,4 +56,19 @@ def create_highlighted_versions():
57if __name__ == "__main__":
58if __name__ == "__main__":
59+ parser = argparse.ArgumentParser(
60+ description="This script creates syntax-highlighted versions of all "
61+ "files in the 'source' directory."
67+ help="Output directory",
72+ args = parser.parse_args()
58− create_highlighted_versions()
74+ create_highlighted_versions(output_basepath=args.output)