Skip to content

Commit 7ec8419

Browse files
committed
docs(docstrings): Fix RST formatting errors in docstrings
why: Sphinx documentation build was failing with RST parsing errors what: - Fix malformed backticks in pane.py capture_pane docstring - Fix parameter format to use NumPy style (param : type, optional) - Convert Markdown code blocks to RST format in options.py module docstring - Fix RST link syntax for Issue 55 reference in common.py - Fix parameter name mismatch (option -> value) in common.py set_environment - Fix type annotation in hooks.py set_hook docstring (str -> int | str)
1 parent 76dad56 commit 7ec8419

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

src/libtmux/common.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def set_environment(self, name: str, value: str) -> None:
6666
----------
6767
name : str
6868
the environment variable name. such as 'PATH'.
69-
option : str
69+
value : str
7070
environment value.
7171
"""
7272
args = ["set-environment"]
@@ -427,9 +427,8 @@ def has_minimum_version(raises: bool = True) -> bool:
427427
No longer returns version, returns True or False
428428
429429
.. versionchanged:: 0.1.7
430-
Versions will now remove trailing letters per `Issue 55`_.
431-
432-
.. _Issue 55: https://github.com/tmux-python/tmuxp/issues/55.
430+
Versions will now remove trailing letters per
431+
`Issue 55 <https://github.com/tmux-python/tmuxp/issues/55>`_.
433432
"""
434433
if get_version() < LooseVersion(TMUX_MIN_VERSION):
435434
if raises:

src/libtmux/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def set_hook(
127127
----------
128128
hook : str
129129
hook to set, e.g. 'aggressive-resize'
130-
value : str
130+
value : int | str
131131
hook command.
132132
133133
Raises

src/libtmux/options.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,17 @@
5252
Inherited options
5353
-----------------
5454
55-
`tmux show-options` -A can include inherited options. The raw output of an inherited
56-
option is detected by the key having a *:
55+
``tmux show-options`` -A can include inherited options. The raw output of an inherited
56+
option is detected by the key having a ``*``::
5757
58-
```
59-
visual-activity* on
60-
visual-bell* off
61-
```
58+
visual-activity* on
59+
visual-bell* off
6260
63-
A list of options that are inherited is kept at `Options.context._inherited_options` and
64-
`Options.context.inherited_options`.
61+
A list of options that are inherited is kept at ``Options.context._inherited_options`` and
62+
``Options.context.inherited_options``.
6563
6664
They are mixed with the normal options,
67-
to differentiate them, run `show_options()` without ``include_inherited=True``.
65+
to differentiate them, run ``show_options()`` without ``include_inherited=True``.
6866
"""
6967

7068
from __future__ import annotations
@@ -604,7 +602,7 @@ def set_option(
604602
605603
.. deprecated:: 0.28
606604
607-
Deprecated by ``g`` for global, use `global_`` instead.
605+
Deprecated by ``g`` for global, use ``global_`` instead.
608606
609607
Raises
610608
------

src/libtmux/pane.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,24 +326,24 @@ def capture_pane(
326326
327327
``$ tmux capture-pane`` to pane.
328328
``$ tmux capture-pane -S -10`` to pane.
329-
``$ tmux capture-pane`-E 3` to pane.
330-
``$ tmux capture-pane`-S - -E -` to pane.
329+
``$ tmux capture-pane -E 3`` to pane.
330+
``$ tmux capture-pane -S - -E -`` to pane.
331331
332332
Parameters
333333
----------
334-
start: [str,int]
334+
start : str | int, optional
335335
Specify the starting line number.
336336
Zero is the first line of the visible pane.
337337
Positive numbers are lines in the visible pane.
338338
Negative numbers are lines in the history.
339-
`-` is the start of the history.
339+
``-`` is the start of the history.
340340
Default: None
341-
end: [str,int]
341+
end : str | int, optional
342342
Specify the ending line number.
343343
Zero is the first line of the visible pane.
344344
Positive numbers are lines in the visible pane.
345345
Negative numbers are lines in the history.
346-
`-` is the end of the visible pane
346+
``-`` is the end of the visible pane.
347347
Default: None
348348
"""
349349
cmd = ["capture-pane", "-p"]

src/libtmux/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,10 @@ def new_session(
487487
when the command exits. NOTE: When this command exits the window
488488
will close. This feature is useful for long-running processes
489489
where the closing of the window upon completion is desired.
490-
x : [int, str], optional
490+
x : int | str, optional
491491
Force the specified width instead of the tmux default for a
492492
detached session
493-
y : [int, str], optional
493+
y : int | str, optional
494494
Force the specified height instead of the tmux default for a
495495
detached session
496496

0 commit comments

Comments
 (0)