From 3fe4eded4460fbf92454a07c4f9cf1c2d2fd7b8d Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Fri, 24 Jun 2022 22:56:11 +0100 Subject: [PATCH] Fixed some sphinx warnings/errors in .rst files. --- changes.txt | 1 - docs/annot.rst | 2 +- docs/changes.rst | 1 - docs/faq.rst | 6 ++---- docs/functions.rst | 2 +- docs/intro.rst | 2 ++ docs/page.rst | 4 ++-- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/changes.txt b/changes.txt index 72a370534..846e90b5a 100644 --- a/changes.txt +++ b/changes.txt @@ -1,7 +1,6 @@ Change Log =========== ------- **Changes in Version 1.20.0** diff --git a/docs/annot.rst b/docs/annot.rst index de4882a01..daec384e2 100644 --- a/docs/annot.rst +++ b/docs/annot.rst @@ -250,7 +250,7 @@ There is a parent-child relationship between an annotation and its page. If the :arg str name: the new name. - .. caution:: If you set the name of a 'Stamp' annotation, then this will **not change** the rectangle, nor will the text be layouted in any way. If you choose a standard text from :ref:`StampIcons` (the **exact** name piece after "STAMP_"), you should receive the original layout. An **arbitrary text** will not be changed to upper case, but be written in font "Times-Bold" as is, horizontally centered in **one line** and be shortened to fit. To get your text fully displayed, its length using fontsize 20 must not exceed 190 pixels. So please make sure that the following inequality is true: ``fitz.get_text_length(text, fontname="tibo", fontsize=20) <= 190``. + .. caution:: If you set the name of a 'Stamp' annotation, then this will **not change** the rectangle, nor will the text be layouted in any way. If you choose a standard text from :ref:`StampIcons` (the **exact** name piece after `"STAMP_"`), you should receive the original layout. An **arbitrary text** will not be changed to upper case, but be written in font "Times-Bold" as is, horizontally centered in **one line** and be shortened to fit. To get your text fully displayed, its length using fontsize 20 must not exceed 190 pixels. So please make sure that the following inequality is true: ``fitz.get_text_length(text, fontname="tibo", fontsize=20) <= 190``. .. method:: set_rect(rect) diff --git a/docs/changes.rst b/docs/changes.rst index 72a370534..846e90b5a 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -1,7 +1,6 @@ Change Log =========== ------- **Changes in Version 1.20.0** diff --git a/docs/faq.rst b/docs/faq.rst index e77091c09..66710bd11 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -8,12 +8,11 @@ Collection of Recipes A collection of recipes in "How-To" format for using PyMuPDF. We aim to extend this section over time. Where appropriate we will refer to the corresponding `Wiki `_ pages, but some duplication may still occur. ----------- + Images ------- ----------- How to Make Images from Document Pages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -591,7 +590,6 @@ Basic code pattern for :meth:`Page.show_pdf_page`. Source and target PDF must be Text ----- ----------- How to Extract all Document Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1259,7 +1257,7 @@ The *path* dictionary has been designed such that it can easily be used by the : 'width': 1.0}] >>> -.. note:: You need (at least) 4 Bézier curves (of 3rd order) to draw a circle with acceptable precision. See this `Wikipedia article`_ for some background. +.. note:: You need (at least) 4 Bézier curves (of 3rd order) to draw a circle with acceptable precision. See this `Wikipedia article `_ for some background. The following is a code snippet which extracts the drawings of a page and re-draws them on a new page:: diff --git a/docs/functions.rst b/docs/functions.rst index 96af887c5..e7138c1a0 100644 --- a/docs/functions.rst +++ b/docs/functions.rst @@ -452,7 +452,7 @@ Yet others are handy, general-purpose utilities. The item sequence represents the **sequence in which these commands are executed** to build the page's appearance. Therefore, if an item's bbox intersects or contains that of a previous item, then the previous item may be (partially) covered / hidden. - So this list is useful to detect such situations. An item's index in this list equals the value of ``"seqno"` keys you will find in the dictionaries returned by :meth:`Page.get_drawings` and :meth:`Page.get_texttrace`. + So this list is useful to detect such situations. An item's index in this list equals the value of ``"seqno"`` keys you will find in the dictionaries returned by :meth:`Page.get_drawings` and :meth:`Page.get_texttrace`. ----- diff --git a/docs/intro.rst b/docs/intro.rst index 01dbcdfcd..fbd9e3adb 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -7,7 +7,9 @@ Introduction .. Don't delete the bar symbol - it forces a line break beneath the image - which is required. + | + **PyMuPDF** is a Python binding for `MuPDF `_ -- a lightweight PDF, XPS, and E-book viewer, renderer, and toolkit, which is maintained and developed by Artifex Software, Inc MuPDF can access files in PDF, XPS, OpenXPS, CBZ, EPUB and FB2 (e-books) formats, and it is known for its top performance and high rendering quality. diff --git a/docs/page.rst b/docs/page.rst index a3946cebd..75213b53c 100644 --- a/docs/page.rst +++ b/docs/page.rst @@ -1578,7 +1578,7 @@ In a nutshell, this is what you can do with PyMuPDF: The page's ``/ArtBox``, ``/BleedBox``, ``/TrimBox``, respectively. If not provided, defaulting to :attr:`Page.cropbox`. - :type: :ref:`Rect: + :type: :ref:`Rect` .. attribute:: mediabox_size @@ -1739,4 +1739,4 @@ The page number "pno" is a 0-based integer ``-∞ < pno < page_count``. .. [#f7] In PDF, an area enclosed by some lines or curves can have a property called "orientation". This is significant for switching on or off the fill color of that area when there exist multiple area overlaps - see discussion in method :meth:`Shape.finish` using the "non-zero winding number" rule. While orientation of curves, quads, triangles and other shapes enclosed by lines always was detectable, this has been impossible for "re" (rectangle) items in the past. Adding the orientation parameter now delivers the missing information. -.. [#f8] Hyphenation detection simply means that if the last character of a line is "-", it will be assumed to be a continuation character. That character will not be found by text searching with its default flag setting. Please take note, that a MuPDF *line* may not always be what you expect: words separated by overly large gaps (e.g. caused by text justification) may constitute seperate MuPDF lines. If then any of these words ends with a hyphen, it will only be found by text searching if hyphenation is switched off. \ No newline at end of file +.. [#f8] Hyphenation detection simply means that if the last character of a line is "-", it will be assumed to be a continuation character. That character will not be found by text searching with its default flag setting. Please take note, that a MuPDF *line* may not always be what you expect: words separated by overly large gaps (e.g. caused by text justification) may constitute seperate MuPDF lines. If then any of these words ends with a hyphen, it will only be found by text searching if hyphenation is switched off.