Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Document structure #214

@bcardarella

Description

@bcardarella

To date we've had a flat document with multiple "root" nodes. We should instead enforce a document structure with a single root node, a Head node and a Body node. The Head should allow for Section node that is intended for various states that can override client states. For example, in the SwiftUI client we have disconnected, reconnecting, and error state views. These views are defined on the client. These have allowed for a native client-side views to be used when server is unavailable (disconnected), in-flight (reconnecting), or when an error happens (error). However, you may want to redefine override these from the server. The server's dead render Head node could include overrides for each:

NML -> Native Markup Language. I do think maybe this would justify a rename of the sigil_LVN to sigil_NML:

~NML"""
<Text>Hi!</Text>
"""
<NML>
  <Head>
    <Style url="..."/>
    <Section template="disconnected">
      ...
    </Section>
     <Section template="reconnecting">
      ...
    </Section>
    <Section template="error">
      ...
    </Section>
  </Head>
  <Body>
  </Body>
</NML>

we can include helpers to delegate each section to it's own external template file:

<NML>
  <Head>
    <Style url="..."/>
    {section(:disconnected)}
    {section(:reconnecting)}
    {section(:error)}
  </Head>
  <Body>
  </Body>
</NML>

I would prefer to use {@error_content} but off the top of my head I'm not sure if that is possible so I'll investigate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions