Metadata-Version: 2.4
Name: python-arch-wiki
Version: 0.1.1
Summary: A terminal interface for browsing the Arch Linux Wiki
Author: Anton Kaplan
Author-email: Anton Kaplan <anton.kaplan@live.ca>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Dist: autocommand>=2.2.2
Requires-Dist: bs4>=0.0.2
Requires-Dist: lxml>=6.0.2
Requires-Dist: platformdirs>=4.11.0
Requires-Dist: requests>=2.32.5
Requires-Dist: rich>=14.2.0
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/termctrlseq/python-arch-wiki
Project-URL: Issues, https://github.com/termctrlseq/python-arch-wiki/issues
Description-Content-Type: text/markdown

# python-arch-wiki

A terminal interface for browsing the [Arch Linux Wiki](https://wiki.archlinux.org/), with an interactive table of contents and article search.

## Installation

The program can be run directly with uvx; install it in a virtual environment if you want access to the source code.

To install latest version from GitHub with source and create a link with a name *wiki* (assuming `~/.local/bin` is in the **PATH**):
```bash
mkdir python_arch_wiki
cd python_arch_wiki
python3 -m venv venv
venv/bin/python -m pip install \
    -e 'python-arch-wiki @ git+https://github.com/termctrlseq/python-arch-wiki.git'
ln -s "$PWD/venv/bin/python-arch-wiki" "$HOME/.local/bin/wiki"
```
Then the source code can be found in `~/python_arch_wiki/venv/src/`.

To add `~/.local/bin` to **PATH** put this in your `~/.bashrc`
```bash
# add ~/.local/bin to PATH if not in it
[[ ":${PATH}:" != *:"${HOME}/.local/bin":* ]] \
    && export PATH="${HOME}/.local/bin:${PATH}"
```

## Usage

Run:
```
uvx python-arch-wiki [-l] [-v] [article name]
```

Or if installed:
```
wiki [-l] [-v] [article name]
```

### Options

```text
-l, --link-url    Show URLs in links
-v, --verbose     Enable debug logging
```

## Examples

Open the table of contents:

```bash
wiki
```

From there, press `/` to search the Arch Wiki. The search uses the Arch Wiki's own search engine, and the results are presented in a navigable menu. For convenience, this can be preferable to specifying a longer query on the command line:

```text
/install
```

For short, specific searches, giving the article name on the command line is often more convenient:

```bash
wiki zram
```

## Controls

| Key                                | Action              |
| ---------------------------------- | ------------------- |
| `↑` / `k` / `Ctrl-P` / `Shift-Tab` | Previous            |
| `↓` / `j` / `Ctrl-N` / `Tab`       | Next                |
| `H`                                | First visible item  |
| `M`                                | Middle visible item |
| `L`                                | Last visible item   |
| `Enter`                            | Open                |
| `Space` / `l`                      | Fold/unfold         |
| `h` / `u` / `Esc`                  | Go up               |
| `/` / `?`                          | Search              |
| `q` / `Ctrl-D`                     | Quit                |

Mouse input is also supported:
| Button              | Action      |
| ------------------- | ----------- |
| *Left click*        | select      |
| *Double left click* | open        |
| *Right click*       | fold/unfold |
| *Wheel*             | navigate    |

Articles are rendered in the terminal and paged with `less`.

## Requirements

* Python 3.13+
* A terminal with `curses` support
* Internet connection
