Demonstrate all supported SolidGroundUX documentation comment
Source: target-root/usr/local/lib/solidgroundux/common/doc-sample.sh
Demonstrate all supported SolidGroundUX documentation comment
Public functions
Internal functions
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_sample_internal_function | Demonstrate an internal function. | — | — |
Description
This file is a documentation fixture and style guide.
It demonstrates:
- The fixed module header structure
- Module header metadata and attribution sections
- Developer prose inside the module header
- Function, variable, and general documentation labels
- Normal and template documentation item markers
- Plain documentation lines
- Style hints
- Function arguments
Notes: The first module header line is always a banner line. The second module header line is always:
The third module header line is always a separator line.
Metadata and Attribution are fixed header sections. Other header sections may be used for developer comments or module-level prose.
Documentation content labels
doc: content_labels
The primary labels are:
fn: Function documentation var: Variable documentation doc: General documentation
Each label can be followed by either a colon or a dollar sign.
A colon indicates a normal documentation item:
fn: Normal function documentation var: Normal variable documentation doc: Normal general documentation
A dollar sign indicates a template documentation item:
fn$ Template function documentation var$ Template variable documentation doc$ Template general documentation
Documentation line markers and style hints
doc: style_hints
The plain documentation marker is:
> Plain documentation line > When used without text, emits an intentional blank line
Style hints are presentation hints layered on top of the structural content type. The renderer reads the exported stylehint value for each documentation line. When the style hint is normal, no additional style class is added. When another value is supplied, the renderer adds a corresponding sh-<stylehint> CSS class.
The currently supported style hints are:
normal Standard rendered text label (:) Label or small subheader text highlight (.) Highlighted text emphasis (!) Emphasized text underline (_) Underlined text quote (~) Quoted or aside text listitem (-) Bullet-style list item indent Reserved indentation style
Style hint examples
doc: style_hint_examples
This is a normal documentation line.
: This is a label line.
This is a highlighted line.
! This is an emphasized line. _ This is an underlined line. ~ This is a quoted or aside line.
- This is a list item.
- This is another list item.
Public variable documentation
var: SAMPLE_PUBLIC_VARIABLE
Purpose
Demonstrate a normal documented variable.
Behavior
- Creates a variable item.
- Uses the variable header/body content type.
- Is included in the variable glossary.
Default
empty
Internal variable documentation
var: _SAMPLE_INTERNAL_VARIABLE
Purpose
Demonstrate an internal variable.
Behavior
- A leading underscore marks the variable as internal.
- The renderer may use this visibility metadata later.
Template variable documentation
var$: SAMPLE_TEMPLATE_VARIABLE
Purpose
Demonstrate the var$ template marker.
Behavior
- The dollar marker means this is a template/example variable.
- Template variables are only shown when the module belongs to the Templates group.
Notes
If a real module implements this variable, document it with var: instead of var$.
Recommended item sections
doc: recommended_item_sections
Purpose
Demonstrate the preferred prose structure for documented items.
Recommended labels
Purpose Behavior Arguments Inputs Outputs Output Side effects Returns Usage Examples Notes
Notes
Omit sections that are not applicable. Function arguments should be documented when the function accepts positional arguments.
Empty section example
doc: empty_section_example
This section intentionally contains body text, so it is not considered empty. A section with no body text, no visible items, and no visible child sections should be omitted from the index by the renderer.
