Collapse state in documents and links

    I talked to Eric Vicenti about storing the collapse state on links and documents.

    Engelbart calls it Level Clipping, which I like because it fixes the behavior globally, embracing the hierarchy instead of patching the problem with collapse and expanding per block.

      Level Clipping. For the designated structure cutoff, show only the statements down to a specified level. Lower-level statements are "clipped" from the view; the worker can thus view just a selected number of the upper levels of his document/file.

    We need to store it in the linking system. This way I can easily embed a piece of information in another document with collapse sections.

    We need to store in the document metadata. This way the author can decide what is more important or less with a default view.

    Chat GPT code snippets:

      Linking System

        Links between documents should support the clipLevel parameter:

          Example link: https://seedhypermedia.com/doc1?clipLevel=2

        This parameter determines the maximum depth of content displayed when the document is rendered.

      Document Metadata

        The document's metadata should store information about its hierarchical structure:

        {
          "title": "Document Title",
          "hierarchy": {
            "levels": 4,
            "defaultClipLevel": 3
          },
          "content": [
            { "id": "1", "level": 1, "text": "Main Heading" },
            { "id": "1.1", "level": 2, "text": "Subsection 1" },
            { "id": "1.1.1", "level": 3, "text": "Detail 1.1" }
          ]
        }