File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,11 +42,15 @@ pdf = MarkdownPdf(toc_level=2, optimize=True)
4242```
4343
4444Add 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
4748from 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
5256Add a second section with external and internal hyperlinks.
Original file line number Diff line number Diff line change @@ -36,11 +36,15 @@ pdf = MarkdownPdf(toc_level=2)
3636```
3737
3838Добавляем в pdf первую секцию. Заголовок не включаем в оглавление.
39+ После добавления секции в pdf свойство ` page_count ` у секции содержит количество созданных страниц pdf для добавленной секции.
3940
4041``` python
4142from 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Добавляем вторую секцию с внешними и внутренними гипер-ссылками.
You can’t perform that action at this time.
0 commit comments