Repository navigation
Rewrite the client as a package against client spec 2.3 - #370
Draft
SpikeTheDragon40k wants to merge 2 commits into
Draft
SpikeTheDragon40k wants to merge 2 commits into
SpikeTheDragon40k wants to merge 2 commits into
Conversation
Replace the single-file tldr.py with a small src/tldr package whose modules map to sections of the client specification: settings, languages, platforms, stores, cache, resolver, render and cli. - Configuration is parsed once from the environment, not at import time. - One resolver (platform before language) replaces three lookup loops. - A placeholder scanner replaces regexes and sentinel strings, fixing triple braces and `<`/`>` being stripped from descriptions. - Platforms are discovered from the cache (dos, cisco-ios, ...). - Adds -S/-E, the spec's issue link on missing pages, and sends warnings to stderr so stdout only carries the page. - The cache downloads per-language archives and swaps them in atomically, refreshing when older than TLDR_CACHE_MAX_AGE. - termcolor is no longer a dependency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SpikeTheDragon40k
requested review from
kbdharun and
sebastiaanspeck
as code owners
October 26, 2026 15:10
Member
|
Converting to a draft as this will most definitely not be merged. |
Managor
marked this pull request as draft
October 26, 2026 15:12
The package split (settings, languages, platforms, http, stores, cache, resolver, render, cli) traded one kind of indirection for another. Go back to the legacy shape: one tldr.py with the legacy function names, flags, environment variables, cache layout and termcolor/shtab dependencies, keeping the fixes. - Page lookup is a single find_page loop over platform, language and source. The user cache, every $XDG_DATA_DIRS/tldr, a -s checkout and a remote mirror are just entries in the source list, so adding a location (as tldr-pages#329 did) is one line instead of a flag threaded through four functions and a third copy of the loop. - Fix the tldr-pages#329 lookup bugs: every XDG_DATA_DIRS entry is used, and a system page on the host platform beats a user-cache page on another platform. - The cache stamp records the languages fetched, so changing LANG downloads the new language instead of waiting for the cache to expire. - Unescape \{\{ and \}\} inside placeholders (aws-dynamodb, fakedata, x8). - TLDR_DOWNLOAD_CACHE_LOCATION takes the tldr.zip URL again, and TLDR_CACHE_ENABLED=0 falls back to the cache on network errors, as documented. Rendering every page of tldr-pages (47,670) with both clients only differs where the legacy client dropped `<`/`>` from descriptions or mangled `{{[, ]+}}`-style placeholders (tuc, pw-loopback). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the single-file tldr.py with a small src/tldr package whose modules map to sections of the client specification: settings, languages, platforms, stores, cache, resolver, render and cli.
</>being stripped from descriptions.