Skip to content

Commit ceb081b

Browse files
committed
feat: render script can skip packaging when rendering handouts!
1 parent 5e2e45d commit ceb081b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

render

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ def find_and_replace_sections(boundaries, section_estimate, fname):
183183
if minitocline:
184184
lower = max((section_estimate - 2), 1) # lower boundary not lower than 1
185185
upper = section_estimate + 2
186-
upper = upper if upper < boundaries["upper"] else boundaries["upper"] + 1 # upper boundary not higher then upper boundary ;-)
186+
upper = (
187+
upper if upper < boundaries["upper"] else boundaries["upper"] + 1
188+
) # upper boundary not higher then upper boundary ;-)
187189
sections = f"{lower}-{upper}"
188190
lines[minitocline] = (
189191
" \\tableofcontents[currentsection, sections={"
@@ -234,9 +236,15 @@ if __name__ == "__main__":
234236
"--sample-directory",
235237
help="needed with `--handout` - should indicate directory with script files (cloze and solution)",
236238
)
239+
parser.add_argument(
240+
"--no-packaging",
241+
help="needed for the CI, which should not attempt to package slides",
242+
default=False,
243+
action=argparse.BooleanOptionalAction,
244+
)
237245
args = parser.parse_args()
238246

239-
if args.handout and not args.sample_directory:
247+
if args.handout and (not args.sample_directory or not args.no_packaging):
240248
print(
241249
"ERROR: must indicate --sample-directory when writing handouts",
242250
file=sys.stderr,
@@ -334,6 +342,9 @@ if __name__ == "__main__":
334342
]
335343
opj = os.path.join
336344

345+
if args.no_packaging:
346+
sys.exit(0)
347+
337348
for root, dirs, files in os.walk(args.sample_directory):
338349
for fname in files:
339350
# restrict to sample files, no helper files

0 commit comments

Comments
 (0)