termrender 2.0.0__tar.gz → 3.0.0__tar.gz

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.
Files changed (54) hide show
  1. {termrender-2.0.0 → termrender-3.0.0}/CHANGELOG.md +59 -0
  2. {termrender-2.0.0 → termrender-3.0.0}/CLAUDE.md +3 -5
  3. {termrender-2.0.0 → termrender-3.0.0}/PKG-INFO +23 -8
  4. {termrender-2.0.0 → termrender-3.0.0}/README.md +21 -6
  5. {termrender-2.0.0 → termrender-3.0.0}/pyproject.toml +6 -1
  6. termrender-3.0.0/scripts/build-mermaid-ascii.sh +36 -0
  7. termrender-3.0.0/src/termrender/CLAUDE.md +1 -0
  8. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/__main__.py +351 -397
  9. termrender-3.0.0/src/termrender/_bin/mermaid-ascii-darwin-arm64 +0 -0
  10. termrender-3.0.0/src/termrender/_mermaid_bin.py +41 -0
  11. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/layout.py +2 -1
  12. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/CLAUDE.md +2 -0
  13. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/borders.py +1 -1
  14. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/mermaid.py +2 -1
  15. termrender-3.0.0/tests/test_cli_contract.py +334 -0
  16. termrender-3.0.0/uv.lock +71 -0
  17. termrender-2.0.0/src/termrender/CLAUDE.md +0 -15
  18. termrender-2.0.0/tests/test_cli_contract.py +0 -209
  19. {termrender-2.0.0 → termrender-3.0.0}/.github/workflows/publish.yml +0 -0
  20. {termrender-2.0.0 → termrender-3.0.0}/.gitignore +0 -0
  21. {termrender-2.0.0 → termrender-3.0.0}/LICENSE +0 -0
  22. {termrender-2.0.0 → termrender-3.0.0}/design.json +0 -0
  23. {termrender-2.0.0 → termrender-3.0.0}/requirements.json +0 -0
  24. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/__init__.py +0 -0
  25. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/blocks.py +0 -0
  26. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/emit.py +0 -0
  27. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/parser.py +0 -0
  28. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/py.typed +0 -0
  29. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/__init__.py +0 -0
  30. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/charts.py +0 -0
  31. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/code.py +0 -0
  32. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/columns.py +0 -0
  33. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/diff.py +0 -0
  34. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/divider.py +0 -0
  35. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/panel.py +0 -0
  36. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/quote.py +0 -0
  37. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/stat.py +0 -0
  38. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/table.py +0 -0
  39. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/text.py +0 -0
  40. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/timeline.py +0 -0
  41. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/renderers/tree.py +0 -0
  42. {termrender-2.0.0 → termrender-3.0.0}/src/termrender/style.py +0 -0
  43. {termrender-2.0.0 → termrender-3.0.0}/tests/__init__.py +0 -0
  44. {termrender-2.0.0 → termrender-3.0.0}/tests/test_charts.py +0 -0
  45. {termrender-2.0.0 → termrender-3.0.0}/tests/test_column_alignment.py +0 -0
  46. {termrender-2.0.0 → termrender-3.0.0}/tests/test_diff.py +0 -0
  47. {termrender-2.0.0 → termrender-3.0.0}/tests/test_inline_badge.py +0 -0
  48. {termrender-2.0.0 → termrender-3.0.0}/tests/test_linebreak.py +0 -0
  49. {termrender-2.0.0 → termrender-3.0.0}/tests/test_mermaid_compat.py +0 -0
  50. {termrender-2.0.0 → termrender-3.0.0}/tests/test_myst_gaps.py +0 -0
  51. {termrender-2.0.0 → termrender-3.0.0}/tests/test_stat.py +0 -0
  52. {termrender-2.0.0 → termrender-3.0.0}/tests/test_tasklist.py +0 -0
  53. {termrender-2.0.0 → termrender-3.0.0}/tests/test_timeline.py +0 -0
  54. {termrender-2.0.0 → termrender-3.0.0}/tests/test_variable_colons.py +0 -0
@@ -1,6 +1,65 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v3.0.0 (2026-05-18)
5
+
6
+ ### Chores
7
+
8
+ - Re-trigger release publish for v3.0.0
9
+ ([`467c583`](https://github.com/crouton-labs/termrender/commit/467c58338de217a417530e0bc32ad0a6973012eb))
10
+
11
+ ### Documentation
12
+
13
+ - **claude-md**: Update CLI invocations to v3 flag form, prune stale notes
14
+ ([`1276bf8`](https://github.com/crouton-labs/termrender/commit/1276bf86261528a725f8a012e2105b359f085eca))
15
+
16
+ ### Features
17
+
18
+ - **cli**: Switch input contract to flags + positional + stdin
19
+ ([`38df421`](https://github.com/crouton-labs/termrender/commit/38df4218af8c26d469a442b87090ad268ae47b0e))
20
+
21
+ Drops JSON-on-stdin in favor of long-form flags, at most one positional, stdin for the markdown
22
+ content blob, per cli-design v2. Output (ANSI for render, JSON elsewhere), errors, and exit codes
23
+ are unchanged.
24
+
25
+ - doc render / doc check now read source from stdin - doc watch / pane open / pane update take path
26
+ as positional - pane update gains --pane-id flag - --color is an enum (auto|on|off) replacing the
27
+ prior bool|null - --watch is presence-only and defaults to false on pane open/update - Internal
28
+ pane self-pipe rebuilds the new flag-form invocations
29
+
30
+
31
+ ## v2.1.0 (2026-05-16)
32
+
33
+ ### Documentation
34
+
35
+ - **claude-md**: Document mermaid-ascii vendoring and correct stale --maxWidth
36
+ ([`643e25a`](https://github.com/crouton-labs/termrender/commit/643e25a791de1f32591b245dee064f290221cfc2))
37
+
38
+ Note _mermaid_bin resolution, the pinned master binary, the no-width-flag reality, and the back-edge
39
+ panic in renderers/CLAUDE.md.
40
+
41
+ - **claude-md**: Note QUOTE +1 height only applies to author/by attrs
42
+ ([`3184d43`](https://github.com/crouton-labs/termrender/commit/3184d43e7293af735b82d559bc3253d7542cbf85))
43
+
44
+ ### Features
45
+
46
+ - **mermaid**: Vendor engine from upstream master, fix broken -w invocation
47
+ ([`d801de5`](https://github.com/crouton-labs/termrender/commit/d801de5bb22ba5205fe52ef65e80eda96590be93))
48
+
49
+ mermaid-ascii has no -w/width flag and never has; layout.py and mermaid.py passed `-w <width>`, so
50
+ every diagram exited non-zero and degraded to raw source text on the 1.2.0 wheel. Drop -w (call is
51
+ now `-f - -y 1`).
52
+
53
+ Resolve the binary via new _mermaid_bin.mermaid_ascii_bin(): prefer vendored
54
+ _bin/mermaid-ascii-<os>-<arch> (built from pinned upstream master 6fffb8e via
55
+ scripts/build-mermaid-ascii.sh), else fall back to `mermaid-ascii` on PATH (PyPI wheel, capped at
56
+ 1.2.0). pyproject ships the binary via hatch artifacts and bumps the fallback dep to >=1.2.
57
+
58
+ Caveats: only darwin-arm64 is vendored (other platforms fall back to the older PyPI engine); a
59
+ labeled back-edge in graph LR panics the binary on both 1.2.0 and master and degrades to source.
60
+ mermaid-ascii has no width control, so wide diagrams overflow (renderer pads, never truncates).
61
+
62
+
4
63
  ## v2.0.0 (2026-05-16)
5
64
 
6
65
  ### Continuous Integration
@@ -4,18 +4,16 @@
4
4
  ```bash
5
5
  pip install -e .
6
6
  pytest tests/
7
- python -m termrender <file.md>
7
+ cat file.md | termrender doc render # render markdown
8
+ cat file.md | termrender doc check # validate syntax
9
+ termrender doc watch /path/to/file.md # live-render
8
10
  python -m build
9
11
  ```
10
12
 
11
- No linter or formatter is configured.
12
-
13
13
  ## Constraints
14
14
  - **Layout pass order is load-bearing**: `resolve_width()` top-down must complete before `resolve_height()` bottom-up — height calls `wrap_text(text, width)`, which requires width already set.
15
- - **`borders.py` `render_box` width**: takes **total** width including borders, not content width. Passing content width silently overflows.
16
15
  - **`wrap_text()` CJK bug**: uses `len()` internally, not `visual_len()` — silently overflows for CJK content.
17
16
  - **`_ambiguous_width` is global mutable state** with no reset path — `set_ambiguous_width()` or `TERMRENDER_CJK` env var changes persist for the process lifetime.
18
- - **Version**: derived from git tags via hatch-vcs — no version in `pyproject.toml`. Adding one will conflict.
19
17
  - **Commits**: conventional commits. `feat` → minor, `fix`/`perf` → patch. Auto-released via python-semantic-release on main.
20
18
 
21
19
  ## Supplementary CLAUDE.md files
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: termrender
3
- Version: 2.0.0
3
+ Version: 3.0.0
4
4
  Summary: Rich terminal rendering of directive-flavored markdown
5
5
  Project-URL: Homepage, https://github.com/CaptainCrouton89/termrender
6
6
  Project-URL: Repository, https://github.com/CaptainCrouton89/termrender
@@ -21,7 +21,7 @@ Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Topic :: Terminals
22
22
  Classifier: Topic :: Text Processing :: Markup :: Markdown
23
23
  Requires-Python: >=3.10
24
- Requires-Dist: mermaid-ascii>=1.0
24
+ Requires-Dist: mermaid-ascii>=1.2
25
25
  Requires-Dist: mistune>=3.0
26
26
  Requires-Dist: pygments>=2.0
27
27
  Description-Content-Type: text/markdown
@@ -170,14 +170,29 @@ Python 3.10+. Three dependencies: [mistune](https://github.com/lepture/mistune)
170
170
  ### CLI
171
171
 
172
172
  ```bash
173
- termrender doc.md # render a file
174
- termrender doc.md --width 100 # fixed width
175
- termrender doc.md --no-color # strip ANSI codes
176
- cat doc.md | termrender # from stdin
177
- echo '# Hello' | termrender # inline
173
+ cat doc.md | termrender doc render # render a file
174
+ cat doc.md | termrender doc render --width 100 # fixed width
175
+ cat doc.md | termrender doc render --color off # strip ANSI codes
176
+ cat doc.md | termrender doc render --color on --cjk # force color + CJK mode
177
+ echo '# Hello' | termrender doc render # inline
178
+
179
+ cat doc.md | termrender doc check # validate syntax
180
+ termrender doc watch /path/to/doc.md # live-render (interactive)
181
+ termrender doc watch --color on /path/to/doc.md # live-render with color
178
182
  ```
179
183
 
180
- Reads from a file or stdin. Auto-detects terminal width unless you specify `--width`. Respects `NO_COLOR`.
184
+ `doc render` and `doc check` read markdown from stdin. `doc watch` takes the file path as a positional argument. Auto-detects terminal width unless you specify `--width`. Respects `NO_COLOR` with `--color auto` (the default).
185
+
186
+ For tmux pane management:
187
+
188
+ ```bash
189
+ termrender pane open /path/to/doc.md # spawn a side pane
190
+ termrender pane open --watch /path/to/doc.md # spawn with live-update
191
+ termrender pane open --width 80 --window new /path/to/doc.md
192
+
193
+ termrender pane update /path/to/new.md --pane-id %23 # update existing pane
194
+ termrender pane update --watch /path/to/doc.md --pane-id %23
195
+ ```
181
196
 
182
197
  ### Python
183
198
 
@@ -142,14 +142,29 @@ Python 3.10+. Three dependencies: [mistune](https://github.com/lepture/mistune)
142
142
  ### CLI
143
143
 
144
144
  ```bash
145
- termrender doc.md # render a file
146
- termrender doc.md --width 100 # fixed width
147
- termrender doc.md --no-color # strip ANSI codes
148
- cat doc.md | termrender # from stdin
149
- echo '# Hello' | termrender # inline
145
+ cat doc.md | termrender doc render # render a file
146
+ cat doc.md | termrender doc render --width 100 # fixed width
147
+ cat doc.md | termrender doc render --color off # strip ANSI codes
148
+ cat doc.md | termrender doc render --color on --cjk # force color + CJK mode
149
+ echo '# Hello' | termrender doc render # inline
150
+
151
+ cat doc.md | termrender doc check # validate syntax
152
+ termrender doc watch /path/to/doc.md # live-render (interactive)
153
+ termrender doc watch --color on /path/to/doc.md # live-render with color
150
154
  ```
151
155
 
152
- Reads from a file or stdin. Auto-detects terminal width unless you specify `--width`. Respects `NO_COLOR`.
156
+ `doc render` and `doc check` read markdown from stdin. `doc watch` takes the file path as a positional argument. Auto-detects terminal width unless you specify `--width`. Respects `NO_COLOR` with `--color auto` (the default).
157
+
158
+ For tmux pane management:
159
+
160
+ ```bash
161
+ termrender pane open /path/to/doc.md # spawn a side pane
162
+ termrender pane open --watch /path/to/doc.md # spawn with live-update
163
+ termrender pane open --width 80 --window new /path/to/doc.md
164
+
165
+ termrender pane update /path/to/new.md --pane-id %23 # update existing pane
166
+ termrender pane update --watch /path/to/doc.md --pane-id %23
167
+ ```
153
168
 
154
169
  ### Python
155
170
 
@@ -28,7 +28,7 @@ classifiers = [
28
28
  ]
29
29
  dependencies = [
30
30
  "mistune>=3.0",
31
- "mermaid-ascii>=1.0",
31
+ "mermaid-ascii>=1.2",
32
32
  "pygments>=2.0",
33
33
  ]
34
34
 
@@ -45,6 +45,11 @@ source = "vcs"
45
45
 
46
46
  [tool.hatch.build.targets.wheel]
47
47
  packages = ["src/termrender"]
48
+ # Ship the vendored mermaid-ascii binary (built from pinned upstream master;
49
+ # see scripts/build-mermaid-ascii.sh). It lives inside the package dir so the
50
+ # default file selection includes it; artifacts ensures it survives even if
51
+ # VCS-ignored, and hatchling preserves its 0o755 exec bit.
52
+ artifacts = ["src/termrender/_bin/*"]
48
53
 
49
54
  [tool.semantic_release]
50
55
  version_toml = []
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ # Build the vendored mermaid-ascii binary from pinned upstream master.
3
+ #
4
+ # Usage: scripts/build-mermaid-ascii.sh
5
+ #
6
+ # Produces src/termrender/_bin/mermaid-ascii-<os>-<arch> for the *host*
7
+ # platform. Run on each target platform (or with GOOS/GOARCH set) to refresh
8
+ # the vendored binaries. Requires a Go toolchain (>=1.21).
9
+ #
10
+ # Why vendored: the PyPI `mermaid-ascii` wheel only ships up to 1.2.0, which
11
+ # lacks the master-only flowchart fixes (multiline node labels, duplicate /
12
+ # bidirectional edge-label separation, subgraph titles, wide-rune label
13
+ # widths). termrender prefers this binary and falls back to the PyPI wheel's
14
+ # `mermaid-ascii` on PATH for platforms not vendored here.
15
+ set -euo pipefail
16
+
17
+ # Pinned upstream commit (github.com/AlexanderGrooff/mermaid-ascii master).
18
+ PIN="6fffb8e2714acab2c4cb41c78894fabbc62cee56"
19
+
20
+ repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
21
+ workdir="$(mktemp -d)"
22
+ trap 'rm -rf "$workdir"' EXIT
23
+
24
+ git clone https://github.com/AlexanderGrooff/mermaid-ascii.git "$workdir/src"
25
+ git -C "$workdir/src" checkout --quiet "$PIN"
26
+
27
+ os="$(go env GOOS)"
28
+ arch="$(go env GOARCH)"
29
+ out="$repo_root/src/termrender/_bin/mermaid-ascii-${os}-${arch}"
30
+
31
+ mkdir -p "$(dirname "$out")"
32
+ ( cd "$workdir/src" && go build -trimpath -o "$out" . )
33
+ chmod 755 "$out"
34
+
35
+ echo "Built $out"
36
+ "$out" --help >/dev/null && echo "Smoke test OK (pin ${PIN:0:7})"
@@ -0,0 +1 @@
1
+ - **QUOTE** height gets `+1` only when `author` or `by` attr is set. Using any other key (`attribution`, `source`) silently omits the extra line — the renderer's attribution line is clipped.