@@ -17,6 +17,7 @@ When creating a PDF file you can:
1717- Tune the necessary elements using your CSS code
1818- Use different page sizes within single pdf
1919- Create tables in ` markdown `
20+ - Use clickable hyperlinks. Thanks a lot [ @thongtmtrust ] ( https://github.com/thongtmtrust ) for ideas and collaboration.
2021
2122The module utilizes the functions of two great libraries.
2223
@@ -47,24 +48,38 @@ from markdown_pdf import Section
4748pdf.add_section(Section(" # Title\n " , toc = False ))
4849```
4950
50- Add a second section. In the pdf file it starts on a new page.
51+ Add a second section with external and internal hyperlinks.
52+ In the pdf file it starts on a new page.
53+
54+ ``` python
55+ text = """ # Section with links
56+
57+ - [External link](https://github.com/vb64/markdown-pdf)
58+ - [Internal link to Head1](#head1)
59+ - [Internal link to Head3](#head3)
60+ """
61+
62+ pdf.add_section(Section(text))
63+ ```
64+
65+ Add a third section.
5166The title is centered using CSS, included in the table of contents of the pdf file, and an image from the file ` img/python.png ` is embedded on the page.
5267
5368``` python
5469pdf.add_section(
55- Section(" # Head1\n\n \n\n body\n " ),
70+ Section(" # <a name='head1'></a> Head1\n\n \n\n body\n " ),
5671 user_css = " h1 {text-align:center;}"
5772)
5873```
5974
60- Add a third section. Two headings of different levels from this section are included in the TOC of the pdf file.
75+ Add a next section. Two headings of different levels from this section are included in the TOC of the pdf file.
6176The section has landscape orientation of A4 pages.
6277
6378``` python
64- pdf.add_section(Section(" ## Head2\n\n ### Head3\n\n " , paper_size = " A4-L" ))
79+ pdf.add_section(Section(" ## Head2\n\n ### <a id='head3'></a> Head3\n\n " , paper_size = " A4-L" ))
6580```
6681
67- Add a fourth section with a table.
82+ Add a section with a table.
6883
6984``` python
7085
0 commit comments