From 642b97b98e021ad44f6dc9040c04294a0b91837e Mon Sep 17 00:00:00 2001 From: Nemo Date: Fri, 28 May 2021 18:57:08 +0530 Subject: [PATCH] Adds input for all 3 cases --- src/pystitcher/stitcher.py | 2 +- tests/book-clean.md | 12 ++++++++++++ tests/book-flatten.md | 12 ++++++++++++ tests/{testbook.md => book-keep.md} | 0 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/book-clean.md create mode 100644 tests/book-flatten.md rename tests/{testbook.md => book-keep.md} (100%) diff --git a/src/pystitcher/stitcher.py b/src/pystitcher/stitcher.py index 2a11fff..ba15030 100644 --- a/src/pystitcher/stitcher.py +++ b/src/pystitcher/stitcher.py @@ -96,7 +96,7 @@ class Stitcher: outer_level = self._get_level_from_page_number(b.page+1) # _logger.info("Got Level: %s", outer_level) if (self._flattenBookmarks()): - increment = 1 + increment = 2 else: increment = b.level level = outer_level + increment - 1 diff --git a/tests/book-clean.md b/tests/book-clean.md new file mode 100644 index 0000000..a72c2b6 --- /dev/null +++ b/tests/book-clean.md @@ -0,0 +1,12 @@ +existing_bookmarks: remove +# Super Potato Book + +# Volume 1 + +[Part 1](2page.pdf) +[Part 2](2page.pdf) + +# Volume 2 + +[Part 3](2page.pdf) +[Part 4](2page.pdf) diff --git a/tests/book-flatten.md b/tests/book-flatten.md new file mode 100644 index 0000000..27ffcbd --- /dev/null +++ b/tests/book-flatten.md @@ -0,0 +1,12 @@ +existing_bookmarks: flatten +# Super Potato Book + +# Volume 1 + +[Part 1](2page.pdf) +[Part 2](2page.pdf) + +# Volume 2 + +[Part 3](2page.pdf) +[Part 4](2page.pdf) diff --git a/tests/testbook.md b/tests/book-keep.md similarity index 100% rename from tests/testbook.md rename to tests/book-keep.md