Skip to main content

Static HTML/CSS renderer for panelmark shells.

Project description

panelmark-html

panelmark-html is the static HTML/CSS renderer for the panelmark ecosystem. Given a panelmark shell and its assigned interactions, it produces an HTML document or fragment representing the shell's panel structure.


What this package is

  • A static renderer: layout model in, HTML string out.
  • Useful for server-side rendering into Flask/Django templates, generating reports or dashboards, and automated snapshot tests.
  • The structural foundation that panelmark-web will build live interactivity on top of.

What this package is not

  • It does not handle browser events, keyboard or mouse input, or focus transitions.
  • It does not open sockets, HTTP routes, or sessions.
  • It does not render interaction-internal state (item lists, form fields, text content). Panel bodies are empty placeholders with stable DOM hooks; filling them in with live content is the job of panelmark-web.
  • It does not require JavaScript for its output to be valid HTML.

Relationship to panelmark-web

panelmark-html and panelmark-web are separate packages with distinct scopes.

Package Role
panelmark-html Static structure: panel layout, borders, headings, stable DOM hooks
panelmark-web Live layer: WebSocket sessions, browser events, interaction rendering, draw-command updates

panelmark-web depends on panelmark-html for its rendered structure. The DOM hooks and CSS classes defined here are the stable contract between the two packages.

Installation

pip install panelmark-html

Dependencies

  • panelmark — core layout model and shell state machine
  • No web framework dependency
  • No JavaScript build step

Status

Package maturity: Pre-alpha. The public Python API (render_fragment, render_document, get_base_css, HTMLRenderer) and higher-level rendering features may still evolve.

Hook contract: The region-level DOM hooks (data-pm-region, id, data-pm-* attributes) and CSS classes (.pm-shell, .pm-split-*, .pm-panel, .pm-panel-body) are the intended stable substrate for panelmark-web and are documented as such in docs/hook-contract.md. These will not change without a major version bump.

Quick start

from panelmark import Shell
from panelmark_html import render_fragment, get_base_css

LAYOUT = """
|=== <bold>My App</> ===|
|{$main$            }|
|==================|
|{2R $status$       }|
|==================|
"""

shell = Shell(LAYOUT)
html = render_fragment(shell)
# Panel bodies are empty — fill them with panelmark-web or your own renderer.
print(html)

For a complete HTML document including base CSS:

document = render_document(shell)
# Returns a full <html>...<body>...</body></html> string with embedded CSS.

API

Symbol Description
render_fragment(shell) Renders the shell as an HTML fragment (no <html> or <head> wrapper). Returns a string.
render_document(shell) Renders the shell as a complete HTML document, including the base CSS inline. Returns a string.
get_base_css() Returns the base CSS string for manual inclusion in your own template.
HTMLRenderer Low-level renderer class. Use this for custom integration or when you need per-region control.

All symbols are importable from panelmark_html. Full API reference: panelmark-html rendering API

Documentation

Document Description
Hook Contract Stable DOM interface: element structure, CSS classes, data-pm-* attributes, CSS custom properties. Canonical location — this repo.
Rendering API Reference Full reference for render_fragment, render_document, get_base_css, and HTMLRenderer
Ecosystem Overview How panelmark-html fits into the panelmark package ecosystem
Shell Language ASCII-art layout syntax reference
panelmark-web Live web runtime that builds on this package's hook contract

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panelmark_html-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panelmark_html-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file panelmark_html-0.1.0.tar.gz.

File metadata

  • Download URL: panelmark_html-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for panelmark_html-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a59810c0162d73412262042b7293d602479a348934f694cc5161b6a5303baa23
MD5 0b68998ca6e50d76eb2b5686566d55d7
BLAKE2b-256 a578acfa637fc66fd4ff3214fad1f486b5d484476b6c750589771416c1d96060

See more details on using hashes here.

File details

Details for the file panelmark_html-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: panelmark_html-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for panelmark_html-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce9b4511e7857b441f53a483dc395dd14b838583dbbb246b834bde33bddad295
MD5 7066f7f1542ee9a0a73d5e70cf46f3ab
BLAKE2b-256 5666512afcd1aa899e97699968e5f3584d3e15ff5b58db1d2d74c04a0fab4513

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page