Skip to content

Commit e613411

Browse files
jamie-lemonJorjMcKie
authored andcommitted
Documentation: More syntax updates
1 parent f9663fe commit e613411

File tree

13 files changed

+24
-24
lines changed

13 files changed

+24
-24
lines changed

docs/annot.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ There is a parent-child relationship between an annotation and its page. If the
537537

538538
* *style* -- 1-byte border style: **"S"** (Solid) = solid line surrounding the annotation, **"D"** (Dashed) = dashed line surrounding the annotation, the dash pattern is specified by the *dashes* entry, **"B"** (Beveled) = a simulated embossed rectangle that appears to be raised above the surface of the page, **"I"** (Inset) = a simulated engraved rectangle that appears to be recessed below the surface of the page, **"U"** (Underline) = a single line along the bottom of the annotation rectangle.
539539

540-
* *clouds* -- an integer indicating a "cloudy" border, where `n` is an integer `-1 <= n <= 2`. A value `n = 0` indicates a straight line (no clouds), 1 means small and 2 means large semi-circles, mimicking the cloudy appearance. If -1, then no specification is present.
540+
* *clouds* -- an integer indicating a "cloudy" border, where ``n`` is an integer `-1 <= n <= 2`. A value `n = 0` indicates a straight line (no clouds), 1 means small and 2 means large semi-circles, mimicking the cloudy appearance. If -1, then no specification is present.
541541

542542
:rtype: dict
543543

docs/app3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ MuPDF generates text errors and warnings.
331331
`mupdf_display_warnings()`.
332332

333333
*
334-
These messages are prefixed with `MuPDF error: ` and `MuPDF warning: `
334+
These messages are prefixed with `MuPDF error:` and `MuPDF warning:`
335335
respectively.
336336

337337
Some MuPDF errors may lead to Python exceptions.

docs/archive-class.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In PyMuPDF, archives are currently only used by :ref:`Story` objects to specify
4242

4343
* a Python binary object (`bytes`, `bytearray`, `io.BytesIO`): this will add a single-member sub-archive. In this case, the `path` parameter is **mandatory** and should be the member name under which this item can be found / retrieved.
4444

45-
* a tuple `(data, name)`: This will add a single-member sub-archive with the member name `name`. `data` may be a Python binary object or a local file name (in which case its binary file content is used). Use this format if you need to specify `path`.
45+
* a tuple `(data, name)`: This will add a single-member sub-archive with the member name ``name``. ``data`` may be a Python binary object or a local file name (in which case its binary file content is used). Use this format if you need to specify `path`.
4646

4747
* a Python sequence: This is a convenience format to specify any combination of the above.
4848

docs/document.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ For details on **embedded files** refer to Appendix 3.
10881088

10891089
PDF only: Return the :data:`xref` of the outline item. This is mainly used for internal purposes.
10901090

1091-
arg int idx: index of the item in list :meth:`Document.get_toc`.
1091+
:arg int idx: index of the item in list :meth:`Document.get_toc`.
10921092

10931093
:returns: :data:`xref`.
10941094

docs/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ Yet others are handy, general-purpose utilities.
618618

619619
1. Information above tagged with "(1)" has the same meaning and value as explained in :ref:`TextPage`.
620620

621-
- Please note that the font `flags` value will never contain a *superscript* flag bit: the detection of superscripts is done within MuPDF :ref:`TextPage` code -- it is not a property of any font.
621+
- Please note that the font ``flags`` value will never contain a *superscript* flag bit: the detection of superscripts is done within MuPDF :ref:`TextPage` code -- it is not a property of any font.
622622
- Also note, that the text *color* is encoded as the usual tuple of floats 0 <= f <= 1 -- not in sRGB format. Depending on `span["type"]`, interpret this as fill color or stroke color.
623623

624624
2. There are 3 text span types:

docs/link.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ There is a parent-child relationship between a link and its page. If the page ob
104104

105105
*
106106
`is_external` is true: `uri` points to some target outside the current
107-
PDF, which may be an internet resource (`uri` starts with "http://" or
107+
PDF, which may be an internet resource (`uri` starts with ``http://`` or
108108
similar), another file (`uri` starts with "file:" or "file://") or some
109-
other service like an e-mail address (`uri` starts with "mailto:").
109+
other service like an e-mail address (`uri` starts with ``mailto:``).
110110

111111
*
112112
`is_external` is false: `uri` will be `None` or point to an

docs/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ Command::
479479
* **noligatures:** (bool) corresponds to **not** :data:`TEXT_PRESERVE_LIGATURES`. If specified, ligatures (present in advanced fonts: glyphs combining multiple characters like "fi") are split up into their components (i.e. "f", "i"). Default is passing them through.
480480
* **convert-white:** corresponds to **not** :data:`TEXT_PRESERVE_WHITESPACE`. If specified, all white space characters (like tabs) are replaced with one or more spaces. Default is passing them through.
481481
* **extra-spaces:** (bool) corresponds to **not** :data:`TEXT_INHIBIT_SPACES`. If specified, large gaps between adjacent characters will be filled with one or more spaces. Default is off.
482-
* **noformfeed:** (bool) instead of `hex(12)` (formfeed), write linebreaks `\n` at end of output pages.
482+
* **noformfeed:** (bool) instead of `hex(12)` (formfeed), write linebreaks ``\n`` at end of output pages.
483483
* **skip-empty:** (bool) skip pages with no text.
484484
* **grid:** lines with a vertical coordinate difference of no more than this value (in points) will be merged into the same output line. Only relevant for "layout" mode. **Use with care:** 3 or the default 2 should be adequate in most cases. If **too large**, lines that are *intended* to be different in the original may be merged and will result in garbled and / or incomplete output. If **too low**, artifact separate output lines may be generated for some spans in the input line, just because they are coded in a different font with slightly deviating properties.
485485
* **fontsize:** include text with :data:`fontsize` larger than this value only (default 3). Only relevant for "layout" option.

docs/outline.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ Outline
6767
be evaluated in conjunction with property `is_external`:
6868

6969
*
70-
`is_external` is true: `uri` points to some target outside the current
71-
PDF, which may be an internet resource (`uri` starts with "http://" or
72-
similar), another file (`uri` starts with "file:" or "file://") or some
73-
other service like an e-mail address (`uri` starts with "mailto:").
70+
`is_external` is true: ``uri`` points to some target outside the current
71+
PDF, which may be an internet resource (``uri`` starts with ``http://`` or
72+
similar), another file (``uri`` starts with ``file:`` or ``file://``) or some
73+
other service like an e-mail address (``uri`` starts with ``mailto:``).
7474

7575
*
76-
`is_external` is false: `uri` will be `None` or point to an
76+
`is_external` is false: ``uri`` will be `None` or point to an
7777
internal location. In case of PDF documents, this should either be
7878
*#nnnn* to indicate a 1-based (!) page number *nnnn*, or a named
7979
location. The format varies for other document types, for example

docs/page.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ In a nutshell, this is what you can do with PyMuPDF:
784784

785785
* Parameter ``text`` may be a string as in the other methods. But it will be **interpreted as HTML source** and may therefore also contain HTML language elements -- including styling. The `css` parameter may be used to pass in additional styling instructions.
786786

787-
* Automatic line breaks are generated at word boundaries. The "soft hyphen" character `"&#173;"` (or `&shy;`) can be used to cause hyphenation and thus may also cause line breaks. **Forced** line breaks however are only achievable via the HTML tag `<br>` - `"\\n"` is ignored and will be treated like a space.
787+
* Automatic line breaks are generated at word boundaries. The "soft hyphen" character `"&#173;"` (or `&shy;`) can be used to cause hyphenation and thus may also cause line breaks. **Forced** line breaks however are only achievable via the HTML tag ``<br>`` - ``\n`` is ignored and will be treated like a space.
788788

789789
* With this method the following can be achieved:
790790

@@ -1500,7 +1500,7 @@ In a nutshell, this is what you can do with PyMuPDF:
15001500

15011501
**OCRed text is only available** to PyMuPDF's text extractions and searches if their `textpage` parameter specifies the output of this method.
15021502

1503-
`This <https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/jupyter-notebooks/partial-ocr.ipynb>`_ Jupyter notebook walks through an example for using OCR textpages.
1503+
`This Jupyter notebook <https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/jupyter-notebooks/partial-ocr.ipynb>`_ walks through an example for using OCR textpages.
15041504

15051505
|history_begin|
15061506

@@ -1557,7 +1557,7 @@ In a nutshell, this is what you can do with PyMuPDF:
15571557

15581558
.. note::, quads and rectangles are more reliably recognized as such. (Starting with v1.19.2)
15591559
1560-
Using class :ref:`Shape`, you should be able to recreate the original drawings on a separate (PDF) page with high fidelity under normal, not too sophisticated circumstances. Please see the following comments on restrictions. A coding draft can be found in section "Extractings Drawings" of chapter :ref:`FAQ`.
1560+
Using class :ref:`Shape`, you should be able to recreate the original drawings on a separate (PDF) page with high fidelity under normal, not too sophisticated circumstances. Please see the following comments on restrictions. A coding draft can be found in :ref:`How to Extract Drawings <RecipesDrawingAndGraphics_Extract_Drawings>`.
15611561

15621562
Specifying `extended=True` significantly alters the output. Most importantly, new dictionary types are present: "clip" and "group". All paths will now be organized in a hierarchic structure which is encoded by the new integer key "level", the hierarchy level. Each group or clip establishes a new hierarchy, which applies to all subsequent paths having a *larger* level value. (New in v1.22.0)
15631563

docs/recipes-common-issues-and-their-solutions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Unfortunately there is not much you can do in most of these cases.
165165
* :meth:`Annot.set_flags` (annotation behaviour)
166166
* :meth:`Annot.set_info` (meta information, except changes to *content*)
167167
* :meth:`Annot.set_popup` (create popup or change its rect)
168-
* :meth:`Annot.set_optional_content` (add / remove reference to optional content information)
168+
* :meth:`Annot.set_oc` (add / remove reference to optional content information)
169169
* :meth:`Annot.set_open`
170170
* :meth:`Annot.update_file` (file attachment changes)
171171

0 commit comments

Comments
 (0)