Files
web-framework-resources/docs/starters.md
T

1.9 KiB

Starter plugin and theme functions

Notes, Bookmarks, and Workspace status are complete independent v0.2.0 plugin packages. Each exports plugin from plugin.py and includes namespaced templates plus implementation helpers.

make_collection(plugin_id, name, kind='notes') constructs a shared collection page and summary widget. Its index() lists persistent items on GET. POST requires content.write and the framework CSRF token; it validates titles/content and writes or deletes a collection item, records an audit event, flashes the result, and redirects. Notes accept text content; bookmarks additionally require a safe HTTP(S) or root-relative link. The intro setting controls the page introduction. The summary widget returns the newest five items.

make_notes(plugin_id='notes', name='Notes') and make_bookmarks(plugin_id='bookmarks', name='Bookmarks') select the corresponding collection configuration. make_status(plugin_id='status', name='Workspace status') builds the status page and summary widget; it reports framework version, uptime, enabled plugin count and configured connection count without resolving database passwords or contacting optional services.

Every plugin's blueprint is registered under /plugins/<id>/, protected by authentication, permission, and enabled-state checks. Templates inherit the framework shell. Plugin configuration and collection data persist in the framework control store; restarting the app discovers newly installed Python packages.

Default, Ocean, and Mint are declarative theme presets. Each theme.json declares ID, name, description, version, mode, accent and density. Selection uses the framework's Themes.activate(); effective appearance uses Themes.appearance(). They introduce no executable code or separate server functions.

All resources have JSON metadata and reproducible versioned ZIP archives. See publishing for package layout, checksum validation and update behavior.