Skip to content

Commit 0db49c3

Browse files
committed
docs: Fix some references and RST markup to eliminate Sphinx warnings.
1 parent c926e72 commit 0db49c3

9 files changed

Lines changed: 24 additions & 24 deletions

File tree

docs/library/array.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Classes
1616
.. class:: array.array(typecode, [iterable])
1717

1818
Create array with elements of given type. Initial contents of the
19-
array are given by an `iterable`. If it is not provided, an empty
19+
array are given by *iterable*. If it is not provided, an empty
2020
array is created.
2121

2222
.. method:: append(val)
2323

24-
Append new element to the end of array, growing it.
24+
Append new element *val* to the end of array, growing it.
2525

2626
.. method:: extend(iterable)
2727

28-
Append new elements as contained in an iterable to the end of
28+
Append new elements as contained in *iterable* to the end of
2929
array, growing it.

docs/library/lcd160cr.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Drawing text
172172
------------
173173

174174
To draw text one sets the position, color and font, and then uses
175-
`write` to draw the text.
175+
`LCD160CR.write` to draw the text.
176176

177177
.. method:: LCD160CR.set_pos(x, y)
178178

@@ -279,7 +279,7 @@ Touch screen methods
279279
.. method:: LCD160CR.is_touched()
280280

281281
Returns a boolean: ``True`` if there is currently a touch force on the screen,
282-
`False` otherwise.
282+
``False`` otherwise.
283283

284284
.. method:: LCD160CR.get_touch()
285285

docs/library/pyb.Switch.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Methods
3838

3939
.. method:: Switch.value()
4040

41-
Get the switch state. Returns `True` if pressed down, otherwise `False`.
41+
Get the switch state. Returns ``True`` if pressed down, otherwise ``False``.
4242

4343
.. method:: Switch.callback(fun)
4444

docs/library/uio.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Functions
8181

8282
Open a file. Builtin ``open()`` function is aliased to this function.
8383
All ports (which provide access to file system) are required to support
84-
`mode` parameter, but support for other arguments vary by port.
84+
*mode* parameter, but support for other arguments vary by port.
8585

8686
Classes
8787
-------
@@ -103,7 +103,7 @@ Classes
103103
text-mode I/O (similar to a normal file opened with "t" modifier).
104104
`BytesIO` is used for binary-mode I/O (similar to a normal file
105105
opened with "b" modifier). Initial contents of file-like objects
106-
can be specified with `string` parameter (should be normal string
106+
can be specified with *string* parameter (should be normal string
107107
for `StringIO` or bytes object for `BytesIO`). All the usual file
108108
methods like ``read()``, ``write()``, ``seek()``, ``flush()``,
109109
``close()`` are available on these objects, and additionally, a

docs/library/uselect.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Methods
3535

3636
Register `stream` *obj* for polling. *eventmask* is logical OR of:
3737

38-
* `uselect.POLLIN` - data available for reading
39-
* `uselect.POLLOUT` - more data can be written
38+
* ``uselect.POLLIN`` - data available for reading
39+
* ``uselect.POLLOUT`` - more data can be written
4040

41-
Note that flags like `uselect.POLLHUP` and `uselect.POLLERR` are
41+
Note that flags like ``uselect.POLLHUP`` and ``uselect.POLLERR`` are
4242
*not* valid as input eventmask (these are unsolicited events which
4343
will be returned from `poll()` regardless of whether they are asked
4444
for). This semantics is per POSIX.
@@ -63,7 +63,7 @@ Methods
6363
tuple, depending on a platform and version, so don't assume that its size is 2.
6464
The ``event`` element specifies which events happened with a stream and
6565
is a combination of ``uselect.POLL*`` constants described above. Note that
66-
flags `uselect.POLLHUP` and `uselect.POLLERR` can be returned at any time
66+
flags ``uselect.POLLHUP`` and ``uselect.POLLERR`` can be returned at any time
6767
(even if were not asked for), and must be acted on accordingly (the
6868
corresponding stream unregistered from poll and likely closed), because
6969
otherwise all further invocations of `poll()` may return immediately with

docs/library/ussl.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Functions
1818
Takes a `stream` *sock* (usually usocket.socket instance of ``SOCK_STREAM`` type),
1919
and returns an instance of ssl.SSLSocket, which wraps the underlying stream in
2020
an SSL context. Returned object has the usual `stream` interface methods like
21-
`read()`, `write()`, etc. In MicroPython, the returned object does not expose
22-
socket interface and methods like `recv()`, `send()`. In particular, a
21+
``read()``, ``write()``, etc. In MicroPython, the returned object does not expose
22+
socket interface and methods like ``recv()``, ``send()``. In particular, a
2323
server-side SSL socket should be created from a normal socket returned from
24-
`accept()` on a non-SSL listening server socket.
24+
:meth:`~usocket.socket.accept()` on a non-SSL listening server socket.
2525

2626
Depending on the underlying module implementation in a particular
2727
`MicroPython port`, some or all keyword arguments above may be not supported.

docs/reference/constrained.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ a file it will save RAM if this is done in a piecemeal fashion. Rather than
185185
creating a large string object, create a substring and feed it to the stream
186186
before dealing with the next.
187187

188-
The best way to create dynamic strings is by means of the string `format`
188+
The best way to create dynamic strings is by means of the string ``format()``
189189
method:
190190

191191
.. code::
@@ -259,7 +259,7 @@ were a string.
259259
**Runtime compiler execution**
260260

261261
The Python funcitons `eval` and `exec` invoke the compiler at runtime, which
262-
requires significant amounts of RAM. Note that the `pickle` library from
262+
requires significant amounts of RAM. Note that the ``pickle`` library from
263263
`micropython-lib` employs `exec`. It may be more RAM efficient to use the
264264
`ujson` library for object serialisation.
265265

docs/reference/packages.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ size, which means that to uncompress a compressed stream, 32KB of
4242
contguous memory needs to be allocated. This requirement may be not
4343
satisfiable on low-memory devices, which may have total memory available
4444
less than that amount, and even if not, a contiguous block like that
45-
may be hard to allocate due to `memory fragmentation`. To accommodate
45+
may be hard to allocate due to memory fragmentation. To accommodate
4646
these constraints, MicroPython distribution packages use Gzip compression
4747
with the dictionary size of 4K, which should be a suitable compromise
4848
with still achieving some compression while being able to uncompressed
@@ -243,7 +243,7 @@ the data files as "resources", and abstracting away access to them.
243243
Python supports resource access using its "setuptools" library, using
244244
``pkg_resources`` module. MicroPython, following its usual approach,
245245
implements subset of the functionality of that module, specifically
246-
`pkg_resources.resource_stream(package, resource)` function.
246+
``pkg_resources.resource_stream(package, resource)`` function.
247247
The idea is that an application calls this function, passing a
248248
resource identifier, which is a relative path to data file within
249249
the specified package (usually top-level application package). It

docs/reference/speed_python.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ used for communication with a device. A typical driver will create the buffer in
6363
constructor and use it in its I/O methods which will be called repeatedly.
6464

6565
The MicroPython libraries typically provide support for pre-allocated buffers. For
66-
example, objects which support stream interface (e.g., file or UART) provide `read()`
67-
method which allocates new buffer for read data, but also a `readinto()` method
66+
example, objects which support stream interface (e.g., file or UART) provide ``read()``
67+
method which allocates new buffer for read data, but also a ``readinto()`` method
6868
to read data into an existing buffer.
6969

7070
Floating Point
@@ -109,10 +109,10 @@ the 10K buffer go (be ready for garbage collection), instead of making a
109109
long-living memoryview and keeping 10K blocked for GC.
110110

111111
Nonetheless, `memoryview` is indispensable for advanced preallocated buffer
112-
management. `readinto()` method discussed above puts data at the beginning
112+
management. ``readinto()`` method discussed above puts data at the beginning
113113
of buffer and fills in entire buffer. What if you need to put data in the
114114
middle of existing buffer? Just create a memoryview into the needed section
115-
of buffer and pass it to `readinto()`.
115+
of buffer and pass it to ``readinto()``.
116116

117117
Identifying the slowest section of code
118118
---------------------------------------
@@ -326,7 +326,7 @@ standard approach would be to write
326326
327327
mypin.value(mypin.value() ^ 1) # mypin was instantiated as an output pin
328328
329-
This involves the overhead of two calls to the `Pin` instance's :meth:`~machine.Pin.value()`
329+
This involves the overhead of two calls to the :class:`~machine.Pin` instance's :meth:`~machine.Pin.value()`
330330
method. This overhead can be eliminated by performing a read/write to the relevant bit
331331
of the chip's GPIO port output data register (odr). To facilitate this the ``stm``
332332
module provides a set of constants providing the addresses of the relevant registers.

0 commit comments

Comments
 (0)