Skip to content

Doc / typos fixes #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
edb4621
docs: Fix grammatical error in about.md ('ran' to 'run')
tony Feb 17, 2025
8408049
docs: Fix repeated word 'and' in developing.md
tony Feb 17, 2025
9229a67
docs: Remove redundant 'doctest.' in pytest-plugin/index.md
tony Feb 17, 2025
8288c78
docs: Fix grammatical error in pytest-plugin/index.md ('These are fix…
tony Feb 17, 2025
4f0d1de
docs: Complete session identifier example in about.md
tony Feb 17, 2025
0077537
docs: Improve punctuation in make commands documentation
tony Feb 17, 2025
5115c55
docs: Improve clarity of test stability description in pytest-plugin/…
tony Feb 17, 2025
3acedf5
docs: Fix incorrect verb usage ('custom' -> 'customize') in pytest-pl…
tony Feb 17, 2025
d199cad
docs: Fix incorrect apostrophe usage in plural 'IDs'
tony Feb 17, 2025
724920c
docs: Fix incorrect apostrophe usage in plural 'APIs'
tony Feb 17, 2025
d85bb29
docs: Fix inconsistent pluralization in list of tmux objects
tony Feb 17, 2025
89d8cbe
docs: Make entr(1) references consistent in formatting
tony Feb 17, 2025
b994132
docs: Fix inconsistent capitalization of tmux object names
tony Feb 17, 2025
347b944
docs: Remove extra space before parenthesis
tony Feb 17, 2025
e6e08b5
docs: Make command formatting consistent in developing.md
tony Feb 17, 2025
19b66b6
docs: Remove unnecessary explanation of $ symbol
tony Feb 17, 2025
f920c7d
docs: Make helper command formatting consistent
tony Feb 17, 2025
9927873
docs: Make watch_test command formatting consistent
tony Feb 17, 2025
a442588
docs: Make documentation build commands formatting consistent
tony Feb 17, 2025
80d3790
docs: Standardize key combination format (Ctrl-a -> Ctrl+a)
tony Feb 17, 2025
108895a
docs: Replace # symbol with 'number' for clarity
tony Feb 17, 2025
6e55374
docs: Make start_docs and start commands formatting consistent
tony Feb 17, 2025
78eab59
docs: Make version number formatting consistent (0.10 -> v0.10)
tony Feb 17, 2025
faf9b18
docs: Remove extra blank lines in tmux session creation command block
tony Feb 17, 2025
12123a5
docs: Fix grammar in sessions/windows lookup description
tony Feb 17, 2025
ecaf2a9
docs: Add missing ptpython link definition
tony Feb 17, 2025
c9b5c52
docs: Make method reference format consistent in pytest plugin docs
tony Feb 17, 2025
b14485f
docs: Add missing uv link definition
tony Feb 17, 2025
8c7533f
docs: Make code block formatting consistent in version update example
tony Feb 17, 2025
e0c3958
docs: Make code block formatting consistent in CHANGES example
tony Feb 17, 2025
e8962ac
docs: Make server fixture reference consistent
tony Feb 17, 2025
3d636b1
docs: Make helper commands formatting consistent with console code bl…
tony Feb 17, 2025
b57983b
docs: Make tmux(1) reference formatting consistent
tony Feb 17, 2025
5e8ec6e
docs: Make entr(1) references consistent
tony Feb 17, 2025
7336059
docs: Make make(1) reference formatting consistent
tony Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
libtmux is a [typed](https://docs.python.org/3/library/typing.html) [abstraction layer] for tmux.

It builds upon the concept of targets `-t`, to direct commands against
individual session, windows and panes and `FORMATS`, template variables
individual sessions, windows and panes and `FORMATS`, template variables
exposed by tmux to describe their properties. Think of `-t` analogously
to [scope].

Expand All @@ -32,18 +32,18 @@ relations of {class}`Server`, {class}`Session`, {class}`Window` and
| {class}`Window` | {class}`Pane` | {class}`Session` |
| {class}`Pane` | None | {class}`Window` |

Internally, tmux allows multiple servers to be ran on a system. Each one
Internally, tmux allows multiple servers to be run on a system. Each one
uses a socket. The server-client architecture is executed so cleanly,
many users don't think about it. tmux automatically connects to a default
socket name and location for you if none (`-L`, `-S`) is specified.
A server will be created automatically upon starting if none exists.

A server can have multiple sessions. `Ctrl-a s` can be used to switch
A server can have multiple sessions. `Ctrl+a s` can be used to switch
between sessions running on the server.

Sessions, Windows and Panes all have their own unique identifier for
Sessions, windows and panes all have their own unique identifier for
internal purposes. {class}`common.TmuxMappingObject` will make use of the
unique identifiers (`session_id`, `window_id`, `pane_id` ) to look
unique identifiers (`session_id`, `window_id`, `pane_id`) to look
up the data stored in the {class}`Server` object.

| Object | Prefix | Example |
Expand All @@ -56,7 +56,7 @@ up the data stored in the {class}`Server` object.
## Similarities to tmux and Pythonics

libtmux was built in the spirit of understanding how tmux operates
and how python objects and tools can abstract the API's in a pleasant way.
and how python objects and tools can abstract the APIs in a pleasant way.

libtmux uses `FORMATTERS` in tmux to give identity attributes to
{class}`Session`, {class}`Window` and {class}`Pane` objects. See
Expand All @@ -66,13 +66,13 @@ libtmux uses `FORMATTERS` in tmux to give identity attributes to

How is libtmux able to keep references to panes, windows and sessions?

> Tmux has unique ID's for sessions, windows and panes.
> Tmux has unique IDs for sessions, windows and panes.
>
> panes use `%`, such as `%1234`
>
> windows use `@`, such as `@2345`
>
> sessions use `$`, for money, such as `$`
> sessions use `$`, such as `$13`
>
> How is libtmux able to handle windows with no names?

Expand All @@ -82,7 +82,7 @@ How is libtmux able to keep references to panes, windows and sessions?

> Pane index refers to the order of a pane on the screen.
>
> Window index refers to the # of the window in the session.
> Window index refers to the number of the window in the session.
>
> To assert pane, window and session data, libtmux will use
> {meth}`Server.sessions()`, {meth}`Session.windows()`,
Expand Down
98 changes: 73 additions & 25 deletions docs/developing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development

Install and [git] and [uv]
Install [git] and [uv]

Clone:

Expand All @@ -20,15 +20,29 @@ $ uv sync --all-extras --dev

[installation documentation]: https://docs.astral.sh/uv/getting-started/installation/
[git]: https://git-scm.com/
[uv]: https://github.com/astral-sh/uv

Makefile commands prefixed with `watch_` will watch files and rerun.

## Tests

`uv run py.test`
```console
$ uv run py.test
```

Helpers: `make test`
Rerun tests on file change: `make watch_test` (requires [entr(1)])
### Helpers

```console
$ make test
```

Rerun tests on file change:

```console
$ make watch_test
```

(requires [entr(1)])

### Pytest plugin

Expand All @@ -44,19 +58,50 @@ Default preview server: http://localhost:8023

[sphinx-autobuild] will automatically build the docs, watch for file changes and launch a server.

From home directory: `make start_docs` From inside `docs/`: `make start`
From home directory:
```console
$ make start_docs
```

From inside `docs/`:
```console
$ make start
```

[sphinx-autobuild]: https://github.com/executablebooks/sphinx-autobuild

### Manual documentation (the hard way)

`cd docs/` and `make html` to build. `make serve` to start http server.
```console
$ cd docs/
$ make html
```

to build.

```console
$ make serve
```

to start http server.

Helpers: `make build_docs`, `make serve_docs`
Helpers:
```console
$ make build_docs
$ make serve_docs
```

Rebuild docs on file change: `make watch_docs` (requires [entr(1)])
Rebuild docs on file change:
```console
$ make watch_docs
```
(requires [entr(1)])

Rebuild docs and run server via one terminal: `make dev_docs` (requires above, and a `make(1)` with
Rebuild docs and run server via one terminal:
```console
$ make dev_docs
```
(requires above, and {command}`make(1)` with
`-J` support, e.g. GNU Make)

## Linting
Expand Down Expand Up @@ -95,7 +140,7 @@ $ make ruff
$ make watch_ruff
```

requires [`entr(1)`].
requires [entr(1)].

````

Expand Down Expand Up @@ -177,7 +222,7 @@ $ make mypy
$ make watch_mypy
```

requires [`entr(1)`].
requires [entr(1)].
````

## Releasing
Expand All @@ -197,15 +242,17 @@ Let's assume we pick 0.9.1
`CHANGES`: Assure any PRs merged since last release are mentioned. Give a
thank you to the contributor. Set the header with the new version and the date.
Leave the "current" header and _Insert changes/features/fixes for next release here_ at
the top::
the top:

current
-------
- *Insert changes/features/fixes for next release here*
```
current
-------
- *Insert changes/features/fixes for next release here*

libtmux 0.9.1 (2020-10-12)
--------------------------
- :issue:`1`: Fix bug
libtmux 0.9.1 (2020-10-12)
--------------------------
- :issue:`1`: Fix bug
```

`libtmux/__init__.py` and `__about__.py` - Set version

Expand All @@ -225,20 +272,21 @@ to PyPI.
This isn't used yet since package maintainers may want setup.py in the source.
See https://github.com/tmux-python/tmuxp/issues/625.

As of 0.10, [uv] handles virtualenv creation, package requirements, versioning,
As of v0.10, [uv] handles virtualenv creation, package requirements, versioning,
building, and publishing. Therefore there is no setup.py or requirements files.

Update `__version__` in `__about__.py` and `pyproject.toml`::
Update `__version__` in `__about__.py` and `pyproject.toml`:

git commit -m 'build(libtmux): Tag v0.1.1'
git tag v0.1.1
git push
git push --tags
```console
git commit -m 'build(libtmux): Tag v0.1.1'
git tag v0.1.1
git push
git push --tags
```

[twine]: https://twine.readthedocs.io/
[uv]: https://github.com/astral-sh/uv
[entr(1)]: http://eradman.com/entrproject/
[`entr(1)`]: http://eradman.com/entrproject/
[ruff format]: https://docs.astral.sh/ruff/formatter/
[ruff]: https://ruff.rs
[mypy]: http://mypy-lang.org/
12 changes: 6 additions & 6 deletions docs/pytest-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ The pytest plugin will be automatically detected via pytest, and the fixtures wi
View libtmux's own [tests/](https://github.com/tmux-python/libtmux/tree/master/tests) as well as
tmuxp's [tests/](https://github.com/tmux-python/tmuxp/tree/master/tests).

libtmux's tests `autouse` the {ref}`recommended-fixtures` above to ensure stable, assertions and
libtmux's tests `autouse` the {ref}`recommended-fixtures` above to ensure stable test execution, assertions and
object lookups in the test grid.

## pytest-tmux

`pytest-tmux` works through providing {ref}`pytest fixtures <pytest:fixtures-api>` - so read up on
those!

The plugin's fixtures guarantee a fresh, headless `tmux(1)` server, session, window, or pane is
The plugin's fixtures guarantee a fresh, headless {command}`tmux(1)` server, session, window, or pane is
passed into your test.

(recommended-fixtures)=

## Recommended fixtures

These are fixtures are automatically used when the plugin is enabled and `pytest` is run.
These fixtures are automatically used when the plugin is enabled and `pytest` is run.

- Creating temporary, test directories for:
- `/home/` ({func}`home_path`)
Expand All @@ -67,14 +67,14 @@ options:
- Pass a `config_file` into {class}`~libtmux.Server`
- Set the `HOME` directory to a local or temporary pytest path with a configuration file

You could also read the code and override {func}`server fixtures <libtmux.pytest_plugin.server>`'s in your own doctest. doctest.
You could also read the code and override {func}`server fixture <libtmux.pytest_plugin.server>` in your own doctest.

(custom_session_params)=

### Custom session parameters

You can override `session_params` to custom the `session` fixture. The
dictionary will directly pass into :meth:`Server.new_session` keyword arguments.
You can override `session_params` to customize the `session` fixture. The
dictionary will directly pass into {meth}`Server.new_session` keyword arguments.

```python
import pytest
Expand Down
5 changes: 2 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@ via trunk (can break easily):
```

[pip]: https://pip.pypa.io/en/stable/
[ptpython]: https://github.com/prompt-toolkit/ptpython

## Start a tmux session

Now, let's open a tmux session.

```console

$ tmux new-session -n bar -s foo

```

This tutorial will be using the session and window name in the example.
Expand Down Expand Up @@ -177,7 +176,7 @@ Session($1 ...)

However, this isn't guaranteed, libtmux works against current tmux information, the
session's name could be changed, or another tmux session may be created,
so {meth}`Server.sessions` and {meth}`Server.windows` exists as a lookup.
so {meth}`Server.sessions` and {meth}`Server.windows` exist as a lookup.

## Get session by ID

Expand Down