leo-cub 0.0.2__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,162 @@
1
+ Metadata-Version: 2.4
2
+ Name: leo-cub
3
+ Version: 0.0.2
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: License :: OSI Approved :: Apache Software License
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Rust
11
+ Classifier: Topic :: Text Editors
12
+ Classifier: Topic :: Utilities
13
+ License-File: LICENSE
14
+ Summary: Automation-safe library and CLI for Leo outline files
15
+ Keywords: leo-editor,outline,cli,tui,automation
16
+ Author-email: Ville Vainio <vivainio@gmail.com>
17
+ License: MIT OR Apache-2.0
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
20
+ Project-URL: Homepage, https://github.com/vivainio/leo-cub
21
+ Project-URL: Repository, https://github.com/vivainio/leo-cub
22
+
23
+ # leo-cub
24
+
25
+ `leo-cub` is an experimental Rust library and command-line tool for reading,
26
+ validating, browsing, and modifying [Leo Editor](https://leo-editor.github.io/leo-editor/)
27
+ outlines.
28
+
29
+ The installed command is `cub`; the Rust library namespace is `leo`.
30
+
31
+ ## Screenshot
32
+
33
+ <img width="1836" height="933" alt="image" src="https://github.com/user-attachments/assets/2ff24163-62a2-487b-aaf5-a9ec8c2beb73" />
34
+
35
+ ## Why
36
+
37
+ Leo outlines are not ordinary XML trees. A GNX identifies shared vnode content,
38
+ while an outline position identifies one occurrence of that vnode. Cloned nodes
39
+ can therefore appear in several places. `leo-cub` keeps those concepts separate
40
+ and exposes transactional operations intended for scripts and AI tools.
41
+
42
+ ## Current features
43
+
44
+ - Parse and validate `.leo` XML outlines.
45
+ - Preserve XML outside the rewritten `<vnodes>` and `<tnodes>` sections.
46
+ - Represent clone identity separately from outline positions.
47
+ - Apply atomic JSON operation batches with optional text preconditions.
48
+ - Parse Leo 5 thin derived-file sentinels.
49
+ - Reconstruct `@file`, `@thin`, and `@file-thin` hierarchies and bodies.
50
+ - Resolve ancestor `@path` directives in the TUI.
51
+ - Browse outlines with a small Ratatui interface.
52
+ - Highlight node bodies with Syntect, using `@language` or source extensions.
53
+ - Open a derived node's full source file at its sentinel line using `$VISUAL` or
54
+ `$EDITOR`.
55
+
56
+ ## Install
57
+
58
+ Install the `cub` command from PyPI with
59
+ [pipx](https://pipx.pypa.io/) (recommended for command-line applications):
60
+
61
+ ```sh
62
+ pipx install leo-cub
63
+ ```
64
+
65
+ You can also use `pip install leo-cub`, or download the appropriate archive
66
+ from the [latest GitHub release](https://github.com/vivainio/leo-cub/releases/latest).
67
+
68
+ ## TUI
69
+
70
+ ```sh
71
+ cub tui outline.leo
72
+ ```
73
+
74
+ The browser resolves external thin files in memory.
75
+
76
+ ## TUI keybindings
77
+
78
+ ### Browsing and display
79
+
80
+ | Key | Action |
81
+ | --- | --- |
82
+ | `j`, `↓` / `k`, `↑` | Select next/previous node |
83
+ | `l`, `→`, `Enter` | Expand selected node |
84
+ | `h`, `←` | Collapse selected node |
85
+ | `Home` / `End` | Select the first/last visible node |
86
+ | `Ctrl-P` | Find a headline incrementally; use `↑`/`↓` to cycle matches |
87
+ | `o` | Open the full external source file at the node sentinel |
88
+ | `y` | Toggle syntax highlighting |
89
+
90
+ ### Outline editing
91
+
92
+ | Key | Action |
93
+ | --- | --- |
94
+ | `Ctrl-I` or `Tab` | Insert a new sibling and enter headline editing |
95
+ | `Ctrl-H` or `Backspace` | Edit the selected headline |
96
+ | `Ctrl-↑`, `Ctrl-↓` | Move among siblings |
97
+ | `Ctrl-←`, `Ctrl-→` | Promote or demote the selected node |
98
+ | `Ctrl-S` | Save outline changes |
99
+ | `q` or `Esc` | Quit; press twice to discard unsaved changes |
100
+
101
+ ### Headline editing
102
+
103
+ | Key | Action |
104
+ | --- | --- |
105
+ | Printable characters | Append to the headline |
106
+ | `Backspace` | Delete the previous character |
107
+ | `Enter` | Accept the headline |
108
+ | `Esc` | Cancel editing; a newly inserted node is removed |
109
+
110
+ Use `--no-derived` to display only the hierarchy physically present in the
111
+ `.leo` XML file.
112
+
113
+ For source navigation, `cub` recognizes common position arguments for Vim,
114
+ Neovim, Nano, Emacs, VS Code, Helix, and Kakoune. Other editors receive the file
115
+ path without a line argument.
116
+
117
+ ## Headless commands
118
+
119
+ ```sh
120
+ cub inspect outline.leo
121
+ cub validate outline.leo
122
+ cub diff before.leo after.leo
123
+ cub inspect-derived path/to/derived.py --summary
124
+ cub refresh-derived outline.leo 0 path/to/derived.py --dry-run
125
+ cub apply outline.leo operations.json --dry-run
126
+ ```
127
+
128
+ An operation batch is a JSON object:
129
+
130
+ ```json
131
+ {
132
+ "operations": [
133
+ {
134
+ "op": "set-body",
135
+ "node": "ekr.20260811210000.1",
136
+ "expected": "old body",
137
+ "body": "new body"
138
+ }
139
+ ]
140
+ }
141
+ ```
142
+
143
+ Operations are applied to a copy and committed only if the complete batch is
144
+ valid. `expected` provides optimistic conflict detection for headline and body
145
+ edits.
146
+
147
+ ## Status and safety
148
+
149
+ This project is early and the file format support is incomplete. In particular,
150
+ it does not yet write thin derived files, dynamically interpret every
151
+ `@comment`/`@delims` change, or fully reconstruct all doc-part forms. Keep
152
+ backups and use `--dry-run` when testing write operations on important outlines.
153
+
154
+ The TUI overlays derived files without modifying either the outline or external
155
+ source files. Derived descendants are read-only in the outline editor; use `o`
156
+ to edit their full external source. Unsaved outline changes require a second
157
+ `q` before they are discarded.
158
+
159
+ ## License
160
+
161
+ MIT
162
+
@@ -0,0 +1,6 @@
1
+ leo_cub-0.0.2.data/scripts/cub.exe,sha256=RoJKAF-LfKW1Dovd9_4nZGndwpxyaPY4GUFuHgw4-ng,4187648
2
+ leo_cub-0.0.2.dist-info/METADATA,sha256=ol4qBsdDH698Z4wLe3W56WhqR0lk46-Yn0vOyq9lM3M,5444
3
+ leo_cub-0.0.2.dist-info/WHEEL,sha256=2zDlIYIdD4m4N3p5DVEG3iJhGLdhsBQgdH-FqVkAur8,94
4
+ leo_cub-0.0.2.dist-info/licenses/LICENSE,sha256=cSxMTdD2s8xxO_iE_sg59qOiPSGFW7U_RwdJ2RXSh3g,1098
5
+ leo_cub-0.0.2.dist-info/sboms/leo-cub.cyclonedx.json,sha256=WPuyShLMa53bbjlIGMcrNOKFH8tmMJl8ARkl6aB3vrQ,213747
6
+ leo_cub-0.0.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.14.1)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 leo-cub contributors
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.