Skip to content

Commit e4eec29

Browse files
hanbu97claude
andcommitted
fix: use absolute GitHub URLs for PyPI README images
PyPI does not render relative image paths. The sync script now rewrites docs/images/* paths to raw.githubusercontent.com absolute URLs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cef5e21 commit e4eec29

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tokenusage"
3-
version = "1.2.5"
3+
version = "1.2.6"
44
edition = "2024"
55
description = "Fast Rust CLI/TUI/GUI token usage tracker for Codex, Claude Code, and Antigravity usage."
66
license = "MIT"

pypi/tu/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@ Fast Rust CLI/TUI/GUI token usage tracker for Codex, Claude Code, and Antigravit
1616
<td valign="top" width="50%">
1717
<code>tu</code><br/>
1818
<p align="center">
19-
<a href="docs/images/cli-demo-padded.png"><img src="docs/images/thumbs/cli-demo-padded.png" alt="tu cli demo" height="220" loading="lazy" /></a>
19+
<a href="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/cli-demo-padded.png"><img src="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/thumbs/cli-demo-padded.png" alt="tu cli demo" height="220" loading="lazy" /></a>
2020
</p>
2121
</td>
2222
<td valign="top" width="50%">
2323
<code>tu gui</code><br/>
2424
<p align="center">
25-
<a href="docs/images/gui-demo.png"><img src="docs/images/thumbs/gui-demo.png" alt="tu gui demo" height="220" loading="lazy" /></a>
25+
<a href="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/gui-demo.png"><img src="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/thumbs/gui-demo.png" alt="tu gui demo" height="220" loading="lazy" /></a>
2626
</p>
2727
</td>
2828
</tr>
2929
<tr>
3030
<td valign="top" width="50%">
3131
<code>tu img day</code><br/>
3232
<p align="center">
33-
<a href="docs/images/share-demo.png"><img src="docs/images/thumbs/share-demo.png" alt="tu img daily demo" height="260" loading="lazy" /></a>
33+
<a href="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/share-demo.png"><img src="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/thumbs/share-demo.png" alt="tu img daily demo" height="260" loading="lazy" /></a>
3434
</p>
3535
</td>
3636
<td valign="top" width="50%">
3737
<code>tu img week</code><br/>
3838
<p align="center">
39-
<a href="docs/images/share-week-demo.png"><img src="docs/images/thumbs/share-week-demo.png" alt="tu img weekly demo" height="260" loading="lazy" /></a>
39+
<a href="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/share-week-demo.png"><img src="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/thumbs/share-week-demo.png" alt="tu img weekly demo" height="260" loading="lazy" /></a>
4040
</p>
4141
</td>
4242
</tr>
4343
<tr>
4444
<td valign="top" colspan="2">
4545
<code>tu live</code><br/>
4646
<p align="center">
47-
<a href="docs/images/live-demo.png"><img src="docs/images/thumbs/live-demo.png" alt="tu live demo" width="100%" loading="lazy" /></a>
47+
<a href="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/live-demo.png"><img src="https://raw.githubusercontent.com/hanbu97/tokenusage/main/docs/images/thumbs/live-demo.png" alt="tu live demo" width="100%" loading="lazy" /></a>
4848
</p>
4949
</td>
5050
</tr>
@@ -64,6 +64,12 @@ cargo install tokenusage --bin tu
6464
npm install -g tokenusage
6565
```
6666

67+
### pip (PyPI)
68+
69+
```bash
70+
pip install tokenusage
71+
```
72+
6773
### cargo-binstall (prebuilt binary)
6874

6975
```bash

scripts/sync-pypi-readme.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,23 @@
22
set -euo pipefail
33

44
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5-
cp "${ROOT_DIR}/README.md" "${ROOT_DIR}/pypi/tu/README.md"
6-
echo "Synced pypi/tu/README.md from root README.md"
5+
DEST="${ROOT_DIR}/pypi/tu/README.md"
6+
RAW_BASE="https://raw.githubusercontent.com/hanbu97/tokenusage/main"
7+
8+
cp "${ROOT_DIR}/README.md" "${DEST}"
9+
10+
# PyPI does not render relative image paths — rewrite them to absolute
11+
# GitHub raw URLs. Handle both src="..." and href="..." for docs/images.
12+
if [[ "$(uname)" == "Darwin" ]]; then
13+
sed -i '' \
14+
-e "s|src=\"docs/|src=\"${RAW_BASE}/docs/|g" \
15+
-e "s|href=\"docs/|href=\"${RAW_BASE}/docs/|g" \
16+
"${DEST}"
17+
else
18+
sed -i \
19+
-e "s|src=\"docs/|src=\"${RAW_BASE}/docs/|g" \
20+
-e "s|href=\"docs/|href=\"${RAW_BASE}/docs/|g" \
21+
"${DEST}"
22+
fi
23+
24+
echo "Synced pypi/tu/README.md from root README.md (with absolute image URLs)"

0 commit comments

Comments
 (0)