Browse Source

Correction des bookmarks avant la table des matières

pull/29/head
Youen 2 years ago
parent
commit
5e4746f67c
  1. 3
      sphinx-tools/update_pdf_bookmarks.py

3
sphinx-tools/update_pdf_bookmarks.py

@ -18,7 +18,8 @@ with open(bookmarks_filename) as bookmarks_file:
# Offset page numbers # Offset page numbers
def replaceBookmarkPageNumber(match): def replaceBookmarkPageNumber(match):
initial_page = int(match.group(1)) initial_page = int(match.group(1))
return 'BookmarkPageNumber: ' + str(initial_page + 2) final_page = initial_page + 2 if initial_page > 1 else initial_page
return 'BookmarkPageNumber: ' + str(final_page)
metadata = re.sub('BookmarkPageNumber:\s+([0-9]+)', replaceBookmarkPageNumber, metadata) metadata = re.sub('BookmarkPageNumber:\s+([0-9]+)', replaceBookmarkPageNumber, metadata)
with open(bookmarks_filename, 'w') as bookmarks_file: with open(bookmarks_filename, 'w') as bookmarks_file:

Loading…
Cancel
Save