Skip to content

Support sub-attribute selection for structured attributes in publish configuration #829

Description

@opt12

Summary

The publish list in .doorstop.yml currently only supports simple attribute names (strings). When a published attribute contains a list of dictionaries (structured attribute), Doorstop dumps the raw Python object representation, which renders incorrectly in HTML output.

Proposed Enhancement

Extend the publish entry format to allow selecting specific sub-attributes of structured attributes, including an option to render them as hyperlinks.

Example of a structured extended attribute:

# Item file (e.g. SRS-001.yml)
spec-refs-from:
  - file: specs/login.md
    section: "3.1 Login Process"
    anchor: 31-login-process
    url: https://gitlab.com/group/project/-/blob/main/specs/login.md#31-login-process

Without this feature, publishing spec-refs-from renders as a raw Python object dump. With this feature, specific sub-attributes can be selected for clean output.

New syntax:

attributes:
  publish:
    - simple-attribute          # existing behavior – unchanged
    - attr: spec-refs-from      # structured attribute
      fields:
        - url: section          # {url_key: label_key} → rendered as hyperlink

Behavior

fields entry Result
{url_key: label_key} <a href="{url}">{label}</a>
fieldname plain text value

Multiple list entries are separated by <br> in the output.

Backward Compatibility

Fully backward compatible. All existing string entries in publish behave exactly as before.

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