Skip to content

docs(useLinkify): add hook docs and a minimal live example #9560

Closed

Description

@cixzhang

What: useLinkify — Finds URLs, email addresses and custom patterns in plain text and returns React nodes with a Link for each match; the links respect LinkProvider for client-side routing.

A good example shows: A short comment thread where each comment is plain text, for example "See https://example.com/spec or email [email protected]". The hook turns the URL and the email into links. A custom pattern turns issue references such as "#123" into links too, which shows the patterns option.

Where:

Acceptance criteria:

  • A template block names useLinkify in exampleFor (or alsoExampleFor) and renders in the Examples section of the hook's docsite page.

  • The hook visibly drives the behavior: removing the hook call breaks what the example shows. Minimal code; no unrelated UI or styling.

  • Meets the rule architecture:knowledge-contracts INV28 (docs/architecture/knowledge-contracts.md), quoted here:

    INV28 — Every public hook has a minimal, runnable example that
    demonstrates it.
    A public hook is a hook that a package's committed API
    report lists. Its documentation includes at least one realistic, runnable
    example: a live template block that names the hook as its example target
    (exampleFor, or alsoExampleFor when the block also serves another page).
    The example:

    • shows the hook inside a component solving the use case its docs state;
    • imports the package's own code only through its public entry points;
    • covers the hook's main parameters and return values;
    • passes the docs build;
    • gets its visible behavior from the hook itself, so removing the hook breaks
      what the example shows; and
    • is minimal: only the code needed to show the use case, with no unrelated UI
      or styling.

    How a docs page selects and orders its example blocks belongs to
    architecture:template-authoring. A public hook without a conforming example
    is a docs gap, tracked as an issue in the repository's issue queue (DEC-16).

  • A HookDoc for useLinkify with usage, params and returns, so the hook gets a docsite page.

  • If the example adds a sandbox or docsite route, register it in the route list so the build passes.

Good first issue: start with CONTRIBUTING.md. For orientation, run astryx docs and astryx component --list from the repo root (the CLI is node packages/cli/clients/cli/bin/astryx.mjs). The hook's own tests next to its source show how it is called.

Filed by an AI agent on behalf of the maintainer, as part of a docs-coverage sweep.

Activity

  1. added
    documentation
    good first issue
    on Nov 2, 2026
  2. Mittalnew commented on Nov 3, 2026

    @Mittalnew

    Hi! I'd like to work on this. I'm planning to add a useLinkify.doc.mjs page and a small live example with a short comment thread, where URLs and emails become links and a custom pattern turns "#123" references into links too, to show the patterns option. Could you assign it to me?

  3. added a commit that references this issue on Nov 9, 2026
    c5cc8f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions