Skip to content

Align the getting-started and examples docs with the current pn init scaffold #58

Open

Description

@owenthcarey

Problem

This issue remains actionable on current main after the browser preview and runtime overhauls. Two introductory pages still drift from _MAIN_TEMPLATE in src/pythonnative/cli/pn.py:

  • docs/examples.md says the generated app/main.py "already returns a small counter." The scaffold is a stack navigator with Home and Detail screens, a counter on Home, an "Open detail" button that passes the count, and a Back button on Detail.
  • docs/getting-started.md introduces a different listing as "A minimal app/main.py looks like." The actual scaffold also includes a DetailParams TypedDict, pn.use_route(DetailParams), a themed Home screen inside a ScrollView, and the "Open detail" and "Back" buttons.
  • The navigation paragraph immediately after the getting-started example still says each pushed screen runs in its own reconciler host. The current architecture uses a shared logical application tree; native navigation presents screens while preserving their component state.

Assigned to @ernesthenry. Use the current _MAIN_TEMPLATE as the source of truth, not line numbers or API descriptions from older issues. These source and documentation files have the same content in main and pending PR #86 at the time of this triage.

Requested change

  1. Describe the scaffold in docs/examples.md as a small stack navigator with a counter on Home and a Detail screen. Keep the advice about replacing it with another example.
  2. Replace the getting-started listing with the current _MAIN_TEMPLATE contents, including its import, typed route params, labels, and Back button. Introduce it as the file pn init generates.
  3. Update the nearby navigation explanation to match the shared logical tree and native screen presentation described in docs/concepts/architecture.md; remove the per-screen reconciler-host claim.

Keep this a documentation change to those two pages. Don't change the scaffold or runtime APIs. Follow AGENTS.md and the documentation style guide: straight quotes, no em dashes, and CMOS grammar.

Verification

  • Scaffold a temporary project with pn init and compare its app/main.py with the documentation listing.
  • Follow the documented browser preview steps and verify that the counter, Open detail button, displayed count, and Back button work.
  • uv run --group docs mkdocs build --strict passes, and the updated pages render correctly.

Suggested commit message

docs(mkdocs): align introductory docs with the pn init scaffold

Activity

  1. added
    documentation
    good first issue
    on Sep 2, 2026
  2. ernesthenry commented on Sep 3, 2026

    @ernesthenry
    Contributor

    Heeello @owenthcarey I would like to work on this

  3. changed the title [-]Docs describe the `pn init` scaffold as "a small counter", but it now generates a stack navigator[/-] [+]Align the getting-started and examples docs with the current `pn init` scaffold[/+] on Sep 9, 2026
  4. owenthcarey commented on Sep 9, 2026

    @owenthcarey
    ContributorAuthor

    @ernesthenry, I checked this against current main, and the documentation mismatch is still present. Your assignment stays in place.

    I've refreshed the issue to match the current scaffold: copy _MAIN_TEMPLATE into the getting-started listing, describe the Home/Detail navigator accurately, and update the nearby paragraph that still describes a separate reconciler host for each pushed screen. The browser preview remains the way to try the example. The issue now has a concrete scope so you don't have to reconcile the older API changes yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationgood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions