Skip to content

String pipeline rich return - #15

Merged
lalvarezt merged 6 commits into
mainfrom
string-pipeline-rich-return
Apr 5, 2026
Merged

lalvarezt merged 6 commits into
mainfrom
string-pipeline-rich-return

Conversation

@lalvarezt

Copy link
Copy Markdown
Owner

Summary

This PR adds a rich rendering path for templates and makes Template the canonical public API.

The main driver is enabling downstream callers such as to distinguish literal template text from rendered template substitutions, so they can safely escape only the dynamic parts when building shell commands.

Changes

  • Add rich formatting results for template pipelines
  • Expose per-template rendered outputs alongside the final rendered string
  • Store rich template outputs as borrowed slices/ranges into the final rendered buffer instead of duplicating strings
  • Add accessors for rich results instead of requiring callers to depend on raw struct layout
  • Document the rich rendering APIs in the README, crate docs, and template system guide
  • Rename the public API to consistently use Template
  • Deprecate MultiTemplate as a compatibility alias, with removal planned for the next major release
  • Add parse_template_sections as the canonical parser helper and deprecate parse_multi_template

- expose per-template outputs alongside rendered strings
- share rendering logic across single and structured input formats
- add coverage for rich result behavior and error propagation
- Store rendered ranges instead of owned strings
- Add `RichFormatResult::template_output` for borrowed access
- Update docs and rich-format tests to use the new API
- Add getters for template output positions and rendered ranges
- Add accessors for rendered output and template outputs
- Mark rich result types non-exhaustive for API stability
- Add README and docs coverage for rich rendering
- Update examples for `rendered()` and per-section outputs
- Clarify `RichFormatResult` and `TemplateOutput` behavior
- Update docs and examples to use `Template`
- Mark `MultiTemplate` as a compatibility alias
- Refresh debug/template docs for literal-text templates
- Promote `Template` as the primary API
- Keep `MultiTemplate` as a deprecated compatibility alias
- Update parser, CLI, and tests to use the new name
@lalvarezt lalvarezt self-assigned this Apr 5, 2026
@lalvarezt lalvarezt added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 5, 2026
@lalvarezt
lalvarezt merged commit 5a2999f into main Apr 5, 2026
6 checks passed
lalvarezt added a commit that referenced this pull request Apr 5, 2026
* feat: add rich formatting results for template pipelines

- expose per-template outputs alongside rendered strings
- share rendering logic across single and structured input formats
- add coverage for rich result behavior and error propagation

* refactor: expose rich template outputs as borrowed slices

- Store rendered ranges instead of owned strings
- Add `RichFormatResult::template_output` for borrowed access
- Update docs and rich-format tests to use the new API

* refactor: expose rich format result accessors

- Add getters for template output positions and rendered ranges
- Add accessors for rendered output and template outputs
- Mark rich result types non-exhaustive for API stability

* docs: document rich template rendering APIs

- Add README and docs coverage for rich rendering
- Update examples for `rendered()` and per-section outputs
- Clarify `RichFormatResult` and `TemplateOutput` behavior

* refactor: rename public template API to `Template`

- Update docs and examples to use `Template`
- Mark `MultiTemplate` as a compatibility alias
- Refresh debug/template docs for literal-text templates

* refactor: rename MultiTemplate to Template

- Promote `Template` as the primary API
- Keep `MultiTemplate` as a deprecated compatibility alias
- Update parser, CLI, and tests to use the new name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant