Skip to content

Commit

Permalink
readme: fix n_digits (closes #255)
Browse files Browse the repository at this point in the history
Apart from that, given recent investigation, we should remove/replace
the "render multiple pages concurrently" example.
In general, I'm not sure if these readme examples have a future because
they tend to be a maintenance burden and source of confusion.
  • Loading branch information
mara004 committed Sep 6, 2023
1 parent d4c19b3 commit 76b51ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ Here are some examples of using the support model API.
page_indices = page_indices,
scale = 300/72, # 300dpi resolution
)
n_digits = len(str(n_pages))
for i, image in zip(page_indices, renderer):
image.save("out_%0*d.jpg" % (n_digits, i))
image.save("out_%0*d.jpg" % (n_digits, i+1))
```
* Read the table of contents
Expand All @@ -121,8 +122,7 @@ Here are some examples of using the support model API.
print(
" " * item.level +
"[%s] %s -> %s # %s %s" % (
state, item.title, target, item.view_mode,
[round(c, n_digits) for c in item.view_pos],
state, item.title, target, item.view_mode, item.view_pos,
)
)
```
Expand Down

0 comments on commit 76b51ad

Please sign in to comment.