FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FAQ on platform-specific code omits the browser preview (`IS_WEB`) · Issue #59 · pythonnative/pythonnative · GitHub

Repository navigation

FAQ on platform-specific code omits the browser preview (IS_WEB) #59

Description

Problem

The FAQ entry "Can I write Android-only or iOS-only code?" in docs/meta/faq.md only shows IS_ANDROID and IS_IOS. It still needs an explicit branch for browser preview behavior.

The original desktop instructions are obsolete: #74 replaced the Tkinter preview. On current main, pn preview and pn start set PN_PLATFORM=web; pythonnative.utils.IS_WEB and Platform.is_web identify this runtime, and Platform.OS is "web". IS_DESKTOP and docs/guides/desktop-preview.md no longer exist.

This remains a small documentation issue. It is assigned to @nigelseah24, whose existing PR #85 should be updated for this scope.

Requested change

  • Extend the FAQ's platform-branching bullet and snippet to include IS_WEB:

    from pythonnative.utils import IS_ANDROID, IS_IOS, IS_WEB
    
    if IS_ANDROID:
        ...
    elif IS_IOS:
        ...
    elif IS_WEB:
        ...
  • Explain that pn preview / pn start use PN_PLATFORM=web for the browser preview, and link to ../guides/browser-preview.md.

  • Keep the link to Platform.select({...}) in ../api/platform.md as the declarative alternative. The preview uses the "web" key.

  • Keep the existing distinction that browser preview is a development tool; Android and iOS are the app deployment targets.

  • Update PR docs(mkdocs): cover IS_WEB in the platform-specific code FAQ #85's title and description to refer to browser preview / IS_WEB.

Scope: the platform-specific code FAQ. No runtime changes or new desktop compatibility flags are needed. The Platform reference and browser preview guide already document the current APIs.

Follow AGENTS.md and the documentation style guide: straight quotes, no em dashes, and CMOS grammar.

Verification

  • uv run --group docs mkdocs build --strict passes.
  • View the FAQ with uv run --group docs mkdocs serve; check the snippet and both guide/API links.
  • The change contains no IS_DESKTOP imports or links to the removed desktop preview guide.

Suggested commit message

docs(mkdocs): cover IS_WEB in the platform-specific code FAQ

Activity

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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL