Merge the two inline-renderer implementations into a single _render_inline(children, *, html) function that handles both output modes. The original public functions become one-line wrappers so all dispatch logic lives in one place. Also aligns html_inline handling: the html=True path now escapes the raw content instead of silently dropping it in the plain-text path.
Co-Authored-By: Claude <noreply@anthropic.com>
Collapse the if-seen/else-new branches so the category/group/subcategory
merge logic runs once per entry unconditionally, appending to empty lists
on first sight instead of duplicating the append logic in the else branch.
Annotate seen and entries as dict[str, Any] so ty can resolve the mixed
value types (str, list, None) in each entry dict.
Co-Authored-By: Claude <noreply@anthropic.com>
Use timedelta(hours=CACHE_MAX_AGE_HOURS) so the cache-age check
reads at the intended hours unit directly, removing the conversion
arithmetic.
Co-Authored-By: Claude <noreply@anthropic.com>
Use itertools.batched (stdlib since Python 3.12, targeted by this project)
instead of manual range(0, N, BATCH_SIZE) slicing. Loosen fetch_batch,
build_graphql_query, and parse_graphql_response signatures from list[str]
to Sequence[str] since batched yields tuples.
Co-Authored-By: Claude <noreply@anthropic.com>
The helper only appeared once and the logic is two lines, so the named
function added indirection without clarity. Removed the four dedicated
unit tests that covered the function directly.
Co-Authored-By: Claude <noreply@anthropic.com>
The helper was only called once and the bool(inline.children) guard
was redundant: first_link being non-None already implies inline.children
is non-empty.
Co-Authored-By: Claude <noreply@anthropic.com>
The private helper duplicated _find_child with a hardcoded type filter.
Remove it and call the general helper directly at both call sites.
Co-Authored-By: Claude <noreply@anthropic.com>
Extracts a _href(link) helper that returns link.attrGet('href') narrowed
to str (falling back to '') instead of the raw str|int|float|None union.
Replaces all four attrGet('href') or '' call sites with _href(), fixing
ty errors where the widened union leaked into TypedDict url fields.
Co-Authored-By: Claude <noreply@anthropic.com>
Cache-write shape mismatches the TypedDict and callers mix .get() and
direct access, so the stricter type was providing false safety. Using
dict[str, dict] accurately reflects the actual runtime contract.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace loose list[dict] annotations with concrete TypedDicts imported
from readme_parser so ty can verify call-site compatibility.
Co-Authored-By: Claude <noreply@anthropic.com>
client is the only non-first param and is always required, so the * separator
adds no clarity. Update the call site accordingly.
Co-Authored-By: Claude <noreply@anthropic.com>
Python 3.11 introduced datetime.UTC as a cleaner alias for
datetime.timezone.utc. Both build.py and fetch_github_stars.py
are updated to use the shorter form.
Co-Authored-By: Claude <noreply@anthropic.com>
State reset (current_group_name = None, current_group_cats = []) was
duplicated in both branches of the early-return guard. Move it after
the conditional so it runs exactly once regardless of path.
Co-Authored-By: Claude <noreply@anthropic.com>
Parse the # Sponsors heading in README.md into structured data and
render a dedicated sponsor band above the library index on the site.
Co-Authored-By: Claude <noreply@anthropic.com>
Add three tests against the real README: verify all entries have
non-empty names, valid http(s) URLs, and no broken markdown link
syntax (e.g. '[name(url)' missing the closing '](').
Co-Authored-By: Claude <noreply@anthropic.com>
Rename _GITHUB_OWNER_RE and _GITHUB_NAME_RE to GITHUB_OWNER_RE and
GITHUB_NAME_RE to match the naming style of the other module-level
constants (GRAPHQL_URL, BATCH_SIZE).
Co-Authored-By: Claude <noreply@anthropic.com>
Split _GITHUB_NAME_RE into separate owner and repo patterns.
Owner regex now rejects leading/trailing hyphens and dots (matching
GitHub's actual username rules). Repo regex requires alphanumeric
start but allows dots and underscores anywhere after.
New tests cover GraphQL injection attempts, invalid leading chars,
and valid hyphenated/underscore/dot combinations.
Co-Authored-By: Claude <noreply@anthropic.com>
The flex properties (align-items, flex-direction, flex-wrap, justify-content)
were overriding the default layout unnecessarily on mobile.
Co-Authored-By: Claude <noreply@anthropic.com>
- Hoist reducedMotion and sortHeaders to module scope to avoid repeated
DOM queries on every call
- collapseAll now queries within tbody instead of the full document
- Replace indexOf with includes for tag filtering
- Remove null check on activeSort (always initialized)
- Drop inline section comments that just restate the code
Co-Authored-By: Claude <noreply@anthropic.com>
Only the canonical 'filter' query param is supported. The 'category'
and 'group' aliases were never documented and silently accepted wrong
spellings; removing them prevents hidden coupling to old URL shapes.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace the { type, value } filter object with a plain string value.
Merge data-cats and data-groups row attributes into a single data-tags
attribute. Drop data-type from tag buttons. Consolidate category/group
URL params into a single filter param, keeping backward-compat fallback.
Co-Authored-By: Claude <noreply@anthropic.com>
The same matchMedia query was inlined twice (hero scroll and back-to-top).
Extracted into a shared helper. Also renamed loop variable and reformatted
a chained querySelector call for readability. No behavior change.
Co-Authored-By: Claude <noreply@anthropic.com>
Was in a standalone @media (max-width: 960px) block; now lives inside
the existing mobile breakpoint block alongside sibling expand-row rules.
No visual change.
Co-Authored-By: Claude <noreply@anthropic.com>
Gives the focus ring a bit more breathing room so it doesn't
overlap the button text at the new border-radius.
Co-Authored-By: Claude <noreply@anthropic.com>
Add a data-scroll-to attribute to the hero 'Browse the List' anchor
and a JS handler that calls scrollIntoView instead of letting the
browser follow the href, so the URL hash is never written.
Respects prefers-reduced-motion.
Co-Authored-By: Claude <noreply@anthropic.com>
No behavior change. Reformats inline Jinja2/HTML to follow consistent
two-space indentation and line-length conventions throughout the template.
Co-Authored-By: Claude <noreply@anthropic.com>
Footer text was too small to read comfortably. Bumping to --text-sm
improves legibility without breaking the footer layout.
Co-Authored-By: Claude <noreply@anthropic.com>
Moves overflow-x: clip from the 680px breakpoint into the 960px
breakpoint, removing the duplicate rule. The value was applied twice
across two consecutive breakpoints with no override in between.
Co-Authored-By: Claude <noreply@anthropic.com>
Replaces the width/padding/overflow hack with a clean display:none.
The previous approach collapsed the cells to zero size but kept them
in the layout flow; display:none removes them entirely.
Co-Authored-By: Claude <noreply@anthropic.com>
Add an expand-commit span inside the expand row that displays the last
commit date. Hidden on desktop, visible only on mobile (max-width: 960px)
via media query, mirroring the commit column that appears in the full
table. Relative time formatting is applied via JS on page load.
Co-Authored-By: Claude <noreply@anthropic.com>
Use media='print' + onload swap trick to load the stylesheet
non-blocking. Add noscript fallback for JS-disabled browsers.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace the generic '#' sr-only text with 'Row number' so screen
readers announce a meaningful column header instead of a bare symbol.
Co-Authored-By: Claude <noreply@anthropic.com>
Expand the .tag::after pseudo-element inset and add explicit min-height/
min-width of 44px so the interactive hit area satisfies WCAG 2.5.5. Also
nudge mobile tag padding and font-size slightly for visual consistency.
Co-Authored-By: Claude <noreply@anthropic.com>
Appends a small northeast arrow (↗) after target="_blank" anchors
in hero subtitle, expand description, expand also-see, and footer
sections to signal outbound navigation to keyboard and sighted users.
Co-Authored-By: Claude <noreply@anthropic.com>
Move cursor/hover/user-select styles from .sort-btn to th[data-sort]
so the entire column header cell is the interactive target, not just
the button text node.
Co-Authored-By: Claude <noreply@anthropic.com>
col-cat and expand-row cells need different treatment on mobile:
- col-cat uses display:none (whole column hidden)
- expand-row first/last cells collapse via width/padding/overflow
rather than display:none to avoid breaking table layout
Co-Authored-By: Claude <noreply@anthropic.com>
Table sort triggers were bare th elements, which are not keyboard
focusable or announced as interactive by screen readers. Replace with
button elements inside th so keyboard users can activate sorting and
get proper focus-visible ring.
Co-Authored-By: Claude <noreply@anthropic.com>
Swap the hardcoded 'smooth' scroll behavior for a runtime check so users
who have enabled reduced-motion in their OS get instant (auto) scrolling
instead of the animated kind.
Co-Authored-By: Claude <noreply@anthropic.com>