Skip to content

Commit bd11e75

Browse files
authored
Fix broken anchor links (#1877)
* Fixed the broken anchor links for Margins.md, PageFormatAndOrientation.md, TextColumns.md and TextRegion.md. * Fixed a broken anchor link in Images.md. * Added an entry about fixing broken anchor links to CHANGELOG.md. * Replaced links that lead to other parts of the documentation instead of the API reference.
1 parent 0cbe55d commit bd11e75

10 files changed

Lines changed: 28 additions & 27 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ This can also be enabled programmatically with `warnings.simplefilter('default',
3939
* leading spaces on new lines inside `<pre>` and `<pre><code>` blocks are no longer dropped - _cf._ [issue #1063](https://github.com/py-pdf/fpdf2/issues/1063)
4040
* `FPDF.set_font()` can restore `current_font` when the selected font state diverged - _cf._ [PR #1872](https://github.com/py-pdf/fpdf2/pull/1872)
4141
* embed CID-keyed CFF fonts as raw CFF programs so browser PDF viewers render them correctly - _cf._ [issue #1874](https://github.com/py-pdf/fpdf2/issues/1874)
42+
* fixed broken links on documentation not directly leading to the API reference - _cf._ [issue #1876](https://github.com/py-pdf/fpdf2/issues/1876)
4243
### Changed
4344
* skip byte-for-byte compressed data comparison when zlib-ng is detected, regardless of OS
4445

docs/DocumentOutlineAndTableOfContents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pdf.insert_toc_placeholder(toc.render_toc, allow_extra_pages=True)
6767
---
6868

6969
## Using Outlines and ToC with HTML
70-
When using [`FPDF.write_html`](HTML.md), a document outline is automatically generated, and a ToC can be added with the `<toc>` tag.
70+
When using [`FPDF.write_html`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html), a document outline is automatically generated, and a ToC can be added with the `<toc>` tag.
7171

7272
To customize ToC styling, override the `render_toc` method in a subclass:
7373

docs/Images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ _New in [:octicons-tag-24: 2.8.3](https://github.com/py-pdf/fpdf2/blob/master/CH
240240
241241
The dedicated method for adding output intent to a PDF is [`add_output_intent()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.add_output_intent).
242242

243-
You can optionally provide a [`PDFICCProfileObject`](https://py-pdf.github.io/fpdf2/fpdf/output.html#fpdf.output.PDFICCProfileObject) as `icc_profile`.
243+
You can optionally provide a [`PDFICCProfileObject`](https://py-pdf.github.io/fpdf2/fpdf/output.html#fpdf.output.PDFICCProfile) as `icc_profile`.
244244

245245
Example:
246246
```python

docs/Links.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pdf.multi_cell(
3636
pdf.output("hyperlink.pdf")
3737
```
3838

39-
Links defined this way in Markdown can be styled by setting `FPDF` class attributes `MARKDOWN_LINK_COLOR` (default: `None`) & `MARKDOWN_LINK_UNDERLINE` (default: `True`).
39+
Links defined this way in Markdown can be styled by setting `FPDF` class attributes `MARKDOWN_LINK_COLOR` (default: `None`) & `MARKDOWN_LINK_UNDERLINE` (default: `True`).
4040
Links can also be styled by embedding them in markdown style markers (`**bold**, __italics__, --underlined--, ~~strikethrough~~`):
4141

4242
```python
@@ -79,7 +79,7 @@ pdf.output("hyperlink.pdf")
7979

8080
## Hyperlink with write_html ##
8181

82-
An alternative method using [`FPDF.write_html`](HTML.md):
82+
An alternative method using [`FPDF.write_html`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html):
8383

8484
```python
8585
from fpdf import FPDF
@@ -117,7 +117,7 @@ There are some situations where a user wants to create
117117
an internal link to another page in the PDF document, but
118118
the page number is not known at the time of link creation.
119119
In this case, the link can be created using `pdf.add_link()`
120-
as before, and then later re-reference to a specific page using
120+
as before, and then later re-reference to a specific page using
121121
`pdf.set_link()`. In this example our goal is to link to a
122122
page that occurs after a section with a variable
123123
amount of text, potentially occupying multiple pages:
@@ -161,7 +161,7 @@ Other methods can also insert internal links:
161161

162162
* [FPDF.multi_cell](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell) using `link=` **or** `markdown=True` and this syntax: `[link text](page number)`
163163
* [FPDF.link](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.link)
164-
* [FPDF.write_html](HTML.md) using anchor tags: `<a href="page number">link text</a>`
164+
* [FPDF.write_html](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html) using anchor tags: `<a href="page number">link text</a>`
165165

166166
The unit tests `test_internal_links()` in [test_links.py](https://github.com/py-pdf/fpdf2/blob/master/test/test_links.py) provides examples for all of those methods.
167167

@@ -184,7 +184,7 @@ Other methods can also insert internal links:
184184

185185
* [FPDF.multi_cell](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell) using `link=` **or** `markdown=True` and this syntax: `[link text](other_doc.pdf)`
186186
* [FPDF.link](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.link)
187-
* [FPDF.write_html](HTML.md) using anchor tags: `<a href="other_doc.pdf">link text</a>`
187+
* [FPDF.write_html](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html) using anchor tags: `<a href="other_doc.pdf">link text</a>`
188188

189189
The unit test `test_link_to_other_document()` in [test_links.py](https://github.com/py-pdf/fpdf2/blob/master/test/test_links.py) provides examples for all of those methods.
190190

docs/Margins.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ pdf.set_margin(0)
1414

1515
Several methods can be used to set margins:
1616

17-
* [set_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_margin)
18-
* [set_left_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_left_margin)
19-
* [set_right_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_right_margin)
20-
* [set_top_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_top_margin)
21-
* [set_margins](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_margins)
22-
* [set_auto_page_break](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_auto_page_break)
17+
* [set_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_margin)
18+
* [set_left_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_left_margin)
19+
* [set_right_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_right_margin)
20+
* [set_top_margin](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_top_margin)
21+
* [set_margins](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_margins)
22+
* [set_auto_page_break](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_auto_page_break)

docs/PageFormatAndOrientation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Similarly, an `orientation` parameter can be provided to the [`add_page`](https:
3838

3939
## Page layout & zoom level ##
4040

41-
[`set_display_mode()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.FPDF.set_display_mode) allows to set the **zoom level**:
41+
[`set_display_mode()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_display_mode) allows to set the **zoom level**:
4242
pages can be displayed entirely on screen, occupy the full width of the window, use the real size,
4343
be scaled by a specific zooming factor or use the viewer default (configured in its _Preferences_ menu).
4444

docs/Tables.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,26 +519,26 @@ with pdf.table(text_align="CENTER") as table:
519519
row = table.row()
520520
row.cell("A1", colspan=2, rowspan=3)
521521
row.cell("C1", colspan=2)
522-
522+
523523
row = table.row()
524524
row.cell("C2", colspan=2, rowspan=2)
525-
525+
526526
row = table.row()
527527
# all columns of this row are spanned by previous rows
528-
528+
529529
row = table.row()
530530
row.cell("A4", colspan=4)
531-
531+
532532
row = table.row()
533533
row.cell("A5", colspan=2)
534534
row.cell("C5")
535535
row.cell("D5")
536-
536+
537537
row = table.row()
538538
row.cell("A6")
539539
row.cell("B6", colspan=2, rowspan=2)
540540
row.cell("D6", rowspan=2)
541-
541+
542542
row = table.row()
543543
row.cell("A7")
544544
...
@@ -600,7 +600,7 @@ We have dedicated pages about those topics:
600600

601601
## Using write_html
602602

603-
Tables can also be defined in HTML using [`FPDF.write_html`](HTML.md).
603+
Tables can also be defined in HTML using [`FPDF.write_html`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html).
604604
With the same `data` as above, and column widths defined as percent of the effective width:
605605

606606
```python

docs/Text.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ There are several ways in fpdf to add text to a PDF document, each of which come
1414

1515
## Flowable Text Regions
1616

17-
Text regions allow to insert flowing text into a predefined region on the page. It is possible to change the formatting and even the font within paragraphs, which will still be aligned as one text block.
18-
The currently implemented type of text regions is [text_columns()](TextColumns.md), which defines one or several columns that can be filled sequentially or height-balanced.
17+
Text regions allow to insert flowing text into a predefined region on the page. It is possible to change the formatting and even the font within paragraphs, which will still be aligned as one text block.
18+
The currently implemented type of text regions is [text_columns()](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.text_columns), which defines one or several columns that can be filled sequentially or height-balanced.
1919

20-
## Typography and Language Specific Concepts
20+
## Typography and Language Specific Concepts
2121
### Supported Features
2222
With supporting Unicode fonts, `fpdf2` should handle the following text shaping features correctly. More details can be found in [TextShaping](TextShaping.md).
2323

docs/TextColumns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Columns will always be of equal width.
77
Text columns support all the standard [text region](TextRegion.md) methods, and some extra ones:
88

99
* [`.paragraph()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.paragraph)
10-
* [`.write()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.write)
11-
* [`.ln()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.ln)
10+
* [`.write()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.Paragraph.write)
11+
* [`.ln()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.ParagraphCollectorMixin.ln)
1212
* [`.new_column()`](https://py-pdf.github.io/fpdf2/fpdf/text_region.html#fpdf.text_region.TextColumns.new_column)
1313

1414
A **form feed** character (`\u000c`) in the text will have the same effect as an explicit call to `.new_column()`,

docs/TextRegion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Other types like Table cells, shaped regions and combinations are still in the d
1515
## General Operation ##
1616
Using the different region types and combination always follows the same pattern. The main difference to the normal `FPDF.write()` method is that all added text will first be buffered, and only gets rendered on the page when the context of the region is closed. This is necessary so that text can be aligned within the given boundaries even if its font, style, or size are arbitrarily varied along the way.
1717

18-
* Create the region instance with an `FPDF` method, , for example [text_columns()](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.text_columns).
18+
* Create the region instance with an `FPDF` method, , for example [text_columns()](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.text_columns).
1919
<!--
2020
* future: (_If desired, add or subtract other shapes from it (with geometric regions)_).
2121
-->

0 commit comments

Comments
 (0)