Header Parser

SolidGroundUX DocumentationSolidGroundUX
NL

Read, parse, and update canonical script header comments in SolidGroundUX files

Source: target-root/usr/local/lib/solidgroundux/common/sgnd-comment-header-parser.sh

Read, parse, and update canonical script header comments in SolidGroundUX files

Public functions

Description

Provides parsing, lookup, and update utilities for canonical script header comments used throughout the SolidGroundUX framework.

The library:

  • Detects top-level canonical header sections
  • Loads header section fields into sgnd-datatable structures
  • Extracts banner information such as product and title
  • Reads individual header field values from structured sections
  • Updates existing header fields while preserving formatting
  • Adds missing fields where required
  • Supports checksum, build, and semantic version metadata workflows

Design principles

  • Header comments are treated as structured, machine-readable data
  • Header parsing and header mutation are kept predictable and convention-based
  • Existing field formatting is preserved wherever possible
  • Metadata workflows remain independent from higher-level UI logic

Role in framework

  • Core header metadata parsing and update layer for script tooling
  • Supports release preparation and other header-aware development utilities
  • Provides the canonical API for header field inspection and mutation

Non-goals

  • Parsing arbitrary inline documentation blocks in source bodies
  • Rendering documentation output
  • Acting as a general-purpose text processing library