From 0343d9a15de10f422fd1bf3600da257ca9325164 Mon Sep 17 00:00:00 2001 From: nimaid Date: Sun, 5 Jul 2020 15:36:08 -0700 Subject: [PATCH] Made ToC title correct --- README.md | 24 ++++++++++++++++++++++++ bookdir2pdf.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bb4e36e..d3fabf9 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,27 @@ The `.` is what seperates the ordering numbers from the bookmark name in the dir The `sharpen=1` means not to sharpen during the purification step. +The bookmark structure can be previewed without actually processing any files: + +``` +$ bookdir2pdf.py --input_dir test_dir/ --table_of_contents + +... [output removed] ... + +Example PDF - Table of Contents +------------------------------- +Page #1 Cover Page +Page #2 --- Empty Directory Example #1 +Page #2 --- --- Nested Empty Directory Level 1 +Page #2 --- --- --- Nested Empty Directory Level 2 +Page #2 --- --- --- --- Nested Empty Directory Level 3 +Page #2 Empty Directory Example #2 +Page #2 The First Part +Page #2 --- Chapter 1 +Page #4 --- Chapter 2 +Page #6 The Middle Part +Page #6 --- Chapter 3 +Page #8 --- Chapter 4 +Page #10 The Final Part +Page #10 --- Chapter 5 +Page #12 --- Chapter 6 \ No newline at end of file diff --git a/bookdir2pdf.py b/bookdir2pdf.py index dd90882..082a897 100644 --- a/bookdir2pdf.py +++ b/bookdir2pdf.py @@ -351,7 +351,7 @@ def dir_path(string): # Add nested bookmarks from page_dict print() if args["table_of_contents"]: - toc_title = input_dir_name + " - Table of Contents" + toc_title = pdf_title + " - Table of Contents" print(toc_title) print(''.join(['-' for x in range(len(toc_title))])) else: