From ead8c30acf6fff5679579be54507157ae6509c44 Mon Sep 17 00:00:00 2001 From: Nemo Date: Fri, 28 May 2021 23:04:50 +0530 Subject: [PATCH] Sets default value for existing_bookmarks --- README.rst | 10 ++++++++++ src/pystitcher/stitcher.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 47711b7..5a6bcd9 100644 --- a/README.rst +++ b/README.rst @@ -49,6 +49,16 @@ And the correct metadata:: Configuration options can be specified with Meta data at the top of the file. These include: +====== ====== +Option Notes +====== ====== +fit Default fit of the bookmark. Can be overwritten per bookmark. See `Wiki `_ for more details. +author PDF Author +keywords PDF Keywords +subject PDF Subject +title PDF Title. If left unspecified, first Heading (h1) in the document is used. +existing_bookmarks What to do with existing bookmarks in individual files. Options are ``keep``, ``flatten``, and ``remove``. See `Wiki `_ for more details. + .. _pyscaffold-notes: Note diff --git a/src/pystitcher/stitcher.py b/src/pystitcher/stitcher.py index aa12ab1..145caa5 100644 --- a/src/pystitcher/stitcher.py +++ b/src/pystitcher/stitcher.py @@ -97,7 +97,8 @@ class Stitcher: self.bookmarks.append(b) def _existingBookmarkConfig(self): - return self._getAttribute('existing_bookmarks') + EXISTING_BOOKMARKS_DEFAULT = 'remove' + return self._getAttribute('existing_bookmarks', EXISTING_BOOKMARKS_DEFAULT) def _removeExistingBookmarks(self): return (self._existingBookmarkConfig() == 'remove')