tomes 0.1.0__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tomes
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Education
|
|
7
|
+
Classifier: Intended Audience :: Science/Research
|
|
8
|
+
Classifier: Operating System :: MacOS
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
11
|
+
Classifier: Programming Language :: Rust
|
|
12
|
+
Classifier: Topic :: Education
|
|
13
|
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Summary: Read books made with Quarto in your terminal
|
|
16
|
+
Keywords: books,quarto,terminal,tui,reader,data science
|
|
17
|
+
Author: Jeroen Janssens
|
|
18
|
+
License: MIT
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
21
|
+
Project-URL: Changelog, https://github.com/jeroenjanssens/tomes/blob/main/CHANGELOG.md
|
|
22
|
+
Project-URL: Documentation, https://tomes.jeroenjanssens.com
|
|
23
|
+
Project-URL: Issues, https://github.com/jeroenjanssens/tomes/issues
|
|
24
|
+
Project-URL: Repository, https://github.com/jeroenjanssens/tomes
|
|
25
|
+
|
|
26
|
+
# tomes: read books made with Quarto in your terminal
|
|
27
|
+
|
|
28
|
+
```console
|
|
29
|
+
$ uvx tomes https://r4ds.hadley.nz/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`tomes` reads books and websites made with [Quarto](https://quarto.org) in
|
|
33
|
+
your terminal: from the web, or from a directory with Quarto's output. Without
|
|
34
|
+
a book, it opens the one you read last, or a list of free books to pick from
|
|
35
|
+
(R for Data Science, Python for Data Analysis, R Packages, ggplot2, …).
|
|
36
|
+
Install it with `uv tool install tomes` (or `pipx install tomes`,
|
|
37
|
+
`cargo install tomes`, or a binary from the
|
|
38
|
+
[releases](https://github.com/jeroenjanssens/tomes/releases)).
|
|
39
|
+
|
|
40
|
+
The website, https://tomes.jeroenjanssens.com, shows it at work.
|
|
41
|
+
|
|
42
|
+
For readers of *Data Science at the Command Line* there's
|
|
43
|
+
[`dsatcl`](https://pypi.org/project/dsatcl/): the same reader with that book
|
|
44
|
+
built in, so `uvx dsatcl` opens it right away, also offline.
|
|
45
|
+
|
|
46
|
+
## What it does
|
|
47
|
+
|
|
48
|
+
- **Colors as on the website.** Code keeps its syntax colors, and the output
|
|
49
|
+
of terminal sessions (made with quarto-term) keeps its colors. By default it
|
|
50
|
+
uses your terminal's palette; `Space c` switches to the book's palette, and
|
|
51
|
+
`Space l` switches between its light and dark colors. Code blocks have a
|
|
52
|
+
background, or also a rounded border (`Space k`).
|
|
53
|
+
- **Other books.** `Space o` lists the free books and the ones you've read;
|
|
54
|
+
type a URL or a path to open any other one. Every book remembers where you
|
|
55
|
+
were.
|
|
56
|
+
- **Copy code.** `yc` copies the commands of the block at the cursor (without
|
|
57
|
+
prompts and ➊ markers), `Y` shows labels for every block on screen. Click
|
|
58
|
+
`⧉ copy` with the mouse.
|
|
59
|
+
- **Follow along.** `s` sends the commands to another tmux pane, or to a
|
|
60
|
+
terminal inside the reader (`Space t`). `S` also runs them.
|
|
61
|
+
- **Outline.** `Space e` shows the chapters and the sections of the current
|
|
62
|
+
chapter, and follows you as you read.
|
|
63
|
+
- **Search.** `/` searches the page; `Ctrl-p` searches the whole book and
|
|
64
|
+
jumps to the exact line. Prefixes narrow it down: `#` headings, `$` commands,
|
|
65
|
+
`!` figures, `^` footnotes.
|
|
66
|
+
- **Links, cross-references, and footnotes.** `Enter` follows a link, `f`
|
|
67
|
+
shows labels for every link on screen, `K` shows a footnote or reference in a
|
|
68
|
+
popup, `Ctrl-o` goes back.
|
|
69
|
+
- **Images** with the Kitty, iTerm2, or Sixel protocol, or with colored
|
|
70
|
+
blocks in any other terminal. `Enter` on a figure shows it full screen.
|
|
71
|
+
- **Tables** that fit the width, and scroll sideways when they don't.
|
|
72
|
+
- **Folding.** `za` folds a section, a callout, or long output.
|
|
73
|
+
- **Vim keys**, and the mouse when you want it (`Space m` turns it off).
|
|
74
|
+
Press `?` for all keys.
|
|
75
|
+
|
|
76
|
+
## On the command line
|
|
77
|
+
|
|
78
|
+
```console
|
|
79
|
+
$ tomes ./_book # read a Quarto book on your computer
|
|
80
|
+
$ tomes https://r4ds.hadley.nz/ # read one on the web
|
|
81
|
+
$ tomes -b ./_book toc # the outline
|
|
82
|
+
$ tomes -b ./_book cat 3 | less -R # print chapter 3
|
|
83
|
+
$ tomes -b ./_book commands 3 # every command of chapter 3
|
|
84
|
+
$ tomes -b ./_book search join # search the book
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Books made with bookdown (instead of Quarto) aren't supported yet.
|
|
88
|
+
|
|
89
|
+
## Configuration
|
|
90
|
+
|
|
91
|
+
`tomes config --init` writes an example to `~/.config/tomes/config.toml`.
|
|
92
|
+
Where you were, your bookmarks, and your choices (colors, light or dark, the
|
|
93
|
+
mouse) are saved in `~/.local/state/tomes/state.json`. (`dsatcl` uses
|
|
94
|
+
`~/.config/dsatcl` and `~/.local/state/dsatcl`.)
|
|
95
|
+
|
|
96
|
+
## Your own book in a program
|
|
97
|
+
|
|
98
|
+
`tomes` is also a library: build your book into a program of its own, which
|
|
99
|
+
opens it right away and works offline. Give `tomes::main` a `Profile` with a
|
|
100
|
+
`Companion` (the files of the rendered book, e.g. from `rust-embed`, and
|
|
101
|
+
where the book is on the web). See the documentation of the `tomes` crate, and
|
|
102
|
+
[dsatcl](https://github.com/jeroenjanssens/data-science-at-the-command-line/tree/main/dsatcl)
|
|
103
|
+
for a complete example.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
| File | What |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `quarto.rs` | Quarto's HTML (and quarto-term's) → the document model |
|
|
110
|
+
| `model.rs` | The document model |
|
|
111
|
+
| `layout.rs` | Wraps a page to a width: lines, links, folds, tables |
|
|
112
|
+
| `theme.rs` | Terminal and book colors, light and dark |
|
|
113
|
+
| `app.rs` | State, keys, navigation, actions |
|
|
114
|
+
| `ui.rs` | Drawing |
|
|
115
|
+
| `search.rs` | Searching the whole book |
|
|
116
|
+
| `images.rs` | Image protocols (via ratatui-image) |
|
|
117
|
+
| `termpane.rs` | The embedded terminal and tmux |
|
|
118
|
+
| `book.rs`, `source.rs` | Where a book comes from: built in, a directory, a URL |
|
|
119
|
+
| `library.rs` | The list of free books |
|
|
120
|
+
| `cli.rs` | The command line, and `Profile`/`Companion` |
|
|
121
|
+
|
|
122
|
+
```console
|
|
123
|
+
$ cargo run --release -- https://r4ds.hadley.nz/
|
|
124
|
+
$ cargo test
|
|
125
|
+
$ uvx maturin build --release # a wheel in target/wheels
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`TOMES_NO_QUERY=1` makes tomes ask the terminal nothing at startup (for
|
|
129
|
+
terminals that don't answer); `TOMES_TIMING=1` prints how long the first frame
|
|
130
|
+
took.
|
|
131
|
+
|
|
132
|
+
Releases: bump the version in `Cargo.toml`, add it to `CHANGELOG.md`, and push
|
|
133
|
+
a tag `vX.Y.Z`. `.github/workflows/release.yml` builds the wheels for every
|
|
134
|
+
platform, tests them, publishes them to PyPI and crates.io, and makes a GitHub
|
|
135
|
+
release with the binaries.
|
|
136
|
+
|
|
137
|
+
The code is MIT licensed.
|
|
138
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
tomes-0.1.0.data/scripts/tomes.exe,sha256=AT_ymAEfXBTzuN7rhOtaKgE1rDO7YwZB3empFpBwoXc,9906688
|
|
2
|
+
tomes-0.1.0.dist-info/METADATA,sha256=7J7b0LtS-xGaeg6FajboD9aHKDBEa96twpgmJuVbMyI,6193
|
|
3
|
+
tomes-0.1.0.dist-info/WHEEL,sha256=Uvw7WSmy7Kj2FBk8Va4L_dq4MDW8X5Ynby-pOX3ZNS0,94
|
|
4
|
+
tomes-0.1.0.dist-info/licenses/LICENSE,sha256=ADJkbPif6eTyr00ZDZWQYdUW0I3S_bPJB_pT_GVym1A,1093
|
|
5
|
+
tomes-0.1.0.dist-info/sboms/tomes.cyclonedx.json,sha256=SWhYGi0iOiUFX6yRgxoV48mD26i491hePCwohrXI0XU,433494
|
|
6
|
+
tomes-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jeroen Janssens
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|