Skip to content

Commit 7044454

Browse files
DOC: Use latest package versions (#2907)
While fixing some old/broken reference syntax, some new references I stumbled upon while reviewing the docs have been added.
1 parent 183622e commit 7044454

20 files changed

+90
-94
lines changed

.github/workflows/github-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
- name: Test docs build
171171
run: |
172172
pip install -r requirements/docs.txt
173-
sphinx-build -n -W --keep-going -T -b html docs build/sphinx/html
173+
sphinx-build --nitpicky --fail-on-warning --keep-going --show-traceback --builder html docs build/sphinx/html
174174
175175
package:
176176
name: Build & verify package

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
# If your documentation needs a minimal Sphinx version, state it here.
4343
needs_sphinx = "4.0.0"
4444

45-
myst_all_links_external = True
4645
# Add any Sphinx extension module names here, as strings. They can be
4746
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4847
# ones.
@@ -91,6 +90,10 @@
9190
# This pattern also affects html_static_path and html_extra_path.
9291
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
9392

93+
# Configure MyST extension.
94+
myst_all_links_external = False
95+
myst_heading_anchors = 3
96+
9497

9598
# -- Options for HTML output -------------------------------------------------
9699

@@ -106,7 +109,6 @@
106109
"canonical_url": "",
107110
"analytics_id": "",
108111
"logo_only": True,
109-
"display_version": True,
110112
"prev_next_buttons_location": "bottom",
111113
"style_external_links": False,
112114
# Toc options

docs/dev/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ The title of the PR will be used as the first line of that combined commit messa
5353

5454
The first comment within the commit will be used as the message body.
5555

56-
See [developer intro](intro.html#commit-messages) for more details.
56+
See [developer intro](intro.md#commit-messages) for more details.

docs/dev/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pip install -r requirements/dev.txt
1111

1212
## Running Tests
1313

14-
See [testing pypdf with pytest](testing.md)
14+
See [testing pypdf with pytest](testing.md).
1515

1616
## The sample-files git submodule
1717
The reason for having the submodule `sample-files` is that we want to keep

docs/dev/pypdf-parsing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How pypdf parses PDF files
22

3-
pypdf uses {py:class}`PdfReader <pypdf.PdfReader>` to parse PDF files.
3+
pypdf uses {class}`~pypdf.PdfReader` to parse PDF files.
44
The method {py:meth}`PdfReader.read <pypdf.PdfReader.read>` shows the basic
55
structure of parsing:
66

@@ -19,8 +19,8 @@ structure of parsing:
1919
content streams, which are sequences of PDF operators and operands. pypdf
2020
decodes these content streams by applying filters (e.g., `FlateDecode`,
2121
`LZWDecode`) specified in the stream's dictionary. This is only done when the
22-
object is requested by {py:meth}`PdfReader.get_object
23-
<pypdf.PdfReader.get_object>` which uses the `PdfReader._get_object_from_stream` method.
22+
object is requested by {py:meth}`PdfReader.get_object <pypdf.PdfReader.get_object>`
23+
which uses the `PdfReader._get_object_from_stream` method.
2424

2525
## References
2626

docs/meta/scope-of-pypdf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Out of scope for the moment, but might be added if there are enough contributors
6262
[`reportlab`](https://pypi.org/project/reportlab/) /
6363
[`fpdf2`](https://pypi.org/project/fpdf2/) or document conversion tools like
6464
[`pdfkit`](https://pypi.org/project/pdfkit/).
65-
* **Replacing words within a PDF**: [Extracting text from PDF is hard](https://pypdf.readthedocs.io/en/stable/user/extract-text.html#why-text-extraction-is-hard).
65+
* **Replacing words within a PDF**: [Extracting text from PDF is hard](../user/extract-text.md#why-text-extraction-is-hard).
6666
Replacing text in a reliable way is even harder. For example, one word might
6767
be split into multiple tokens. Hence it's not a simple "search and replace"
6868
in some cases.

docs/modules/PageObject.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ The PageObject Class
1515
:members:
1616
:inherited-members: File
1717
:undoc-members:
18+
19+
.. autofunction:: pypdf.mult

docs/user/add-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
PDF readers vary in the extent they support JavaScript, with some not supporting it at all.
44

55
Adobe has documentation on its support here:
6-
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/index.html
6+
[https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/index.html](https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/index.html)
77

88
## Launch print window on opening
99

docs/user/add-watermark.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ background of the document.
88

99
The process of stamping and watermarking is the same, you just need to set `over` parameter to `True` for stamping and `False` for watermarking.
1010

11-
You can use `merge_page()` if you don't need to transform the stamp:
11+
You can use {func}`~pypdf._page.PageObject.merge_page` if you don't need to transform the stamp:
1212

1313
```python
1414
from pypdf import PdfReader, PdfWriter
@@ -21,7 +21,7 @@ for page in writer.pages:
2121
writer.write("out.pdf")
2222
```
2323

24-
Otherwise use `merge_transformed_page()` with `Transformation()` if you need to translate, rotate, scale, etc. the stamp before merging it to the content page.
24+
Otherwise use {func}`~pypdf._page.PageObject.merge_transformed_page` with {class}`~pypdf.Transformation` if you need to translate, rotate, scale, etc. the stamp before merging it to the content page.
2525

2626
```python
2727
from pathlib import Path
@@ -56,7 +56,7 @@ stamp("example.pdf", "stamp.pdf", "out.pdf")
5656
```
5757

5858
If you are experiencing wrongly rotated watermarks/stamps, try to use
59-
`transfer_rotation_to_content()` on the corresponding pages beforehand
59+
{func}`~pypdf._page.PageObject.transfer_rotation_to_content` on the corresponding pages beforehand
6060
to fix the page boxes.
6161

6262
Example of stamp:

docs/user/adding-pdf-annotations.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you want to add text in a box like this
2222

2323
![](free-text-annotation.png)
2424

25-
you can use the {py:class}`FreeText <pypdf.annotations.FreeText>`:
25+
you can use {class}`~pypdf.annotations.FreeText`:
2626

2727
```python
2828
from pypdf import PdfReader, PdfWriter
@@ -71,7 +71,7 @@ If you want to add a line like this:
7171

7272
![](annotation-line.png)
7373

74-
you can use {py:class}`Line <pypdf.annotations.Line>`:
74+
you can use {class}`~pypdf.annotations.Line`:
7575

7676
```python
7777
from pypdf import PdfReader, PdfWriter
@@ -103,7 +103,7 @@ If you want to add a line like this:
103103

104104
![](annotation-polyline.png)
105105

106-
you can use {py:class}`PolyLine <pypdf.annotations.PolyLine>`:
106+
you can use {class}`~pypdf.annotations.PolyLine`:
107107

108108
```python
109109
from pypdf import PdfReader, PdfWriter
@@ -132,7 +132,7 @@ If you want to add a rectangle like this:
132132

133133
![](annotation-square.png)
134134

135-
you can use {py:class}`Rectangle <pypdf.annotations.Rectangle>`:
135+
you can use {class}`~pypdf.annotations.Rectangle`:
136136

137137
```python
138138
from pypdf import PdfReader, PdfWriter
@@ -166,7 +166,7 @@ If you want to add a circle like this:
166166

167167
![](annotation-circle.png)
168168

169-
you can use {py:class}`Ellipse <pypdf.annotations.Ellipse>`:
169+
you can use {class}`~pypdf.annotations.Ellipse`:
170170

171171
```python
172172
from pypdf import PdfReader, PdfWriter
@@ -195,7 +195,7 @@ If you want to add a polygon like this:
195195

196196
![](annotation-polygon.png)
197197

198-
you can use {py:class}`Polygon <pypdf.annotations.Polygon>`:
198+
you can use {class}`~pypdf.annotations.Polygon`:
199199

200200
```python
201201
from pypdf import PdfReader, PdfWriter
@@ -224,7 +224,7 @@ Manage the Popup windows for markups, looks like this:
224224

225225
![](annotation-popup.png)
226226

227-
you can use the {py:class}`Popup <pypdf.annotations.Popup>`:
227+
you can use {py:class}`~pypdf.annotations.Popup`:
228228

229229
```python
230230
from pypdf.annotations import Popup, Text
@@ -257,8 +257,7 @@ the parent annotation with which this popup annotation shall be associated.
257257

258258
## Link
259259

260-
If you want to add a link, you can use
261-
{py:class}`Link <pypdf.annotations.Link>`:
260+
If you want to add a link, you can use {class}`~pypdf.annotations.Link`:
262261

263262
```python
264263
from pypdf import PdfReader, PdfWriter
@@ -321,7 +320,7 @@ If you want to highlight text like this:
321320

322321
![](annotation-highlight.png)
323322

324-
you can use the {py:class}`Highlight <pypdf.annotations.Highlight>`:
323+
you can use {class}`~pypdf.annotations.Highlight`:
325324

326325
```python
327326
from pypdf import PdfReader, PdfWriter

0 commit comments

Comments
 (0)