From e91c16c214059b2f0420edc5406b05e0809b5f66 Mon Sep 17 00:00:00 2001 From: Kevin Mader Date: Fri, 3 Aug 2018 10:26:25 +0200 Subject: [PATCH] Update export_to_ipynb.py fixing script to handle xkcd.py as well --- tools/export_to_ipynb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/export_to_ipynb.py b/tools/export_to_ipynb.py index c3ef0163a3..272a4f0854 100644 --- a/tools/export_to_ipynb.py +++ b/tools/export_to_ipynb.py @@ -12,6 +12,7 @@ nbook = v4.upgrade(nbook) # Upgrade v3 to v4 all_blocks = ast.parse(text).body line_start = [c.lineno-1 for c in all_blocks] +line_start[0] = 0 lines = text.split('\n') for c_block, s, e in zip(all_blocks, line_start, line_start[1:]+[len(lines)]):