Skip to content

Commit 9de7428

Browse files
committed
step
1 parent e8372e7 commit 9de7428

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ pdf = MarkdownPdf(toc_level=2, optimize=True)
4242
```
4343

4444
Add the first section to the pdf. The title is not included in the table of contents.
45+
After adding a section to a pdf, the `page_count` property in the section contains the number of pdf pages created for the added section.
4546

4647
```python
4748
from markdown_pdf import Section
4849

49-
pdf.add_section(Section("# Title\n", toc=False))
50+
section = Section("# Title\n", toc=False)
51+
assert section.page_count == 0
52+
pdf.add_section(section)
53+
assert section.page_count == 1
5054
```
5155

5256
Add a second section with external and internal hyperlinks.

README_ru.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ pdf = MarkdownPdf(toc_level=2)
3636
```
3737

3838
Добавляем в pdf первую секцию. Заголовок не включаем в оглавление.
39+
После добавления секции в pdf свойство `page_count` у секции содержит количество созданных страниц pdf для добавленной секции.
3940

4041
```python
4142
from markdown_pdf import Section
4243

43-
pdf.add_section(Section("# Title\n", toc=False))
44+
section = Section("# Title\n", toc=False)
45+
assert section.page_count == 0
46+
pdf.add_section(section)
47+
assert section.page_count == 1
4448
```
4549

4650
Добавляем вторую секцию с внешними и внутренними гипер-ссылками.

0 commit comments

Comments
 (0)