Safe document rendering for Tempest

One source.
Every publishing surface.

A complete tour of the Tempest integration: view components, profiles, extensions, caching, diagnostics, editor source lines, and four output formats.

Safe modeCachedSource linesHeading numbers
article.crv
# Carve meets Tempest /Readable source/ becomes *safe HTML*, with _underlines_, =highlights=, smart typography -- and links to [Tempest](https://tempestphp.com/). ## Built for application content - Safe-by-default raw HTML handling - Named publishing profiles - Container-resolved extensions - Source-line annotations for editor synchronization > The configured renderer numbers headings and caches this output. ```php $html = $carve->render($source); ``` ```=html <script>alert('This is escaped, never executed')</script> ``` ## Recent syntax |= Feature |={>} Engines |={~} Status | | Braced cell alignment | 3 | new | | Continuation marker | 3 | stable | ^ Alignment sits in braces glued to the cell marker A comment line between two source lines %% Erased before layout, so it never splits the paragraph. keeps them in one paragraph. - A lone plus attaches the next block to this item + > This quote belongs to the item above, with no indentation. - The list stays tight {table} ```csv Target,Output HTML,Safe markup "Plain text, ANSI",Terminals and mail ```

01 · View component

Drop Carve into a Tempest view #

The output below comes directly from <x-carve :content="$componentSource" />. The application config enables safe mode, source-line annotations, heading numbering, smart typography, and Tempest Cache.

1 Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

1.1 Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);
<script>alert('This is escaped, never executed')</script>

1.2 Recent syntax

Alignment sits in braces glued to the cell marker
FeatureEnginesStatus
Braced cell alignment3new
Continuation marker3stable

A comment line between two source lines keeps them in one paragraph.

  • A lone plus attaches the next block to this item

    This quote belongs to the item above, with no indentation.

  • The list stays tight
TargetOutput
HTMLSafe markup
Plain text, ANSITerminals and mail

02 · Publishing profiles

Match the vocabulary to the context #

The same document is filtered through each carve-php profile. Restricted constructs degrade to text instead of disappearing silently.

full

The complete vocabulary, still escaped by safe mode.

Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);
<script>alert('This is escaped, never executed')</script>

Recent syntax

Alignment sits in braces glued to the cell marker
FeatureEnginesStatus
Braced cell alignment3new
Continuation marker3stable

A comment line between two source lines keeps them in one paragraph.

  • A lone plus attaches the next block to this item

    This quote belongs to the item above, with no indentation.

  • The list stays tight
TargetOutput
HTMLSafe markup
Plain text, ANSITerminals and mail
article

Editorial content without raw HTML.

Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);
<script>alert('This is escaped, never executed')</script>

Recent syntax

Alignment sits in braces glued to the cell marker
FeatureEnginesStatus
Braced cell alignment3new
Continuation marker3stable

A comment line between two source lines keeps them in one paragraph.

  • A lone plus attaches the next block to this item

    This quote belongs to the item above, with no indentation.

  • The list stays tight
TargetOutput
HTMLSafe markup
Plain text, ANSITerminals and mail
comment

User content with constrained structure and links.

# Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

## Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);
<script>alert('This is escaped, never executed')</script>

## Recent syntax

Feature | Engines | Status
Braced cell alignment | 3 | new
Continuation marker | 3 | stable

A comment line between two source lines keeps them in one paragraph.

  • A lone plus attaches the next block to this item

    This quote belongs to the item above, with no indentation.

  • The list stays tight

Target | Output
HTML | Safe markup
Plain text, ANSI | Terminals and mail

minimal

Short-form text with basic inline formatting.

# Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

## Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

> The configured renderer numbers headings and caches this output.

$html = $carve->render($source);

<script>alert('This is escaped, never executed')</script>

## Recent syntax

Feature | Engines | Status
Braced cell alignment | 3 | new
Continuation marker | 3 | stable

A comment line between two source lines keeps them in one paragraph.

  • A lone plus attaches the next block to this item > This quote belongs to the item above, with no indentation.
  • The list stays tight

Target | Output
HTML | Safe markup
Plain text, ANSI | Terminals and mail

03 · Output formats

Render once for every channel #

HTML for pages, Markdown for interchange, plain text for search and excerpts, and ANSI for the terminal.

HTML

1 Portable output

One source can serve many targets.

Markdown
# Portable output *One source* can serve **many targets**.
Plain text
Portable output One source can serve many targets.
ANSI
\e[1m\e[95mPortable output\e[0m \e[95m═══════════════\e[0m \e[3mOne source\e[0m can serve \e[1mmany targets\e[0m.

04 · Database-backed includes

Compose documents from reusable sources #

A container-injected resolver backed by an in-memory SQLite repository loads Carve snippets from rows. The included row references a sibling row relatively, automatic heading shifts preserve the assembled outline, a CSV row becomes a table with @rows and @cols picking records and columns, and content revisions invalidate cached output.

Parent document
# Composed handbook {{ /handbook/overview @shift:auto }} {table} {{ /handbook/targets.csv @code:csv @rows:2-3 @cols:"Target,Output" }}
Expanded result

1 Composed handbook

1.1 Database chapter

This Carve source was loaded from an in-memory SQLite row.

1.1.1 Nested database snippet

The resolver uses the including record as context, so relative includes work across rows.

TargetOutput
HTMLSafe markup
ANSITerminal colors

Tracked dependencies: db:handbook/overview, db:handbook/details, db:handbook/targets.csv · 0 warnings

05 · Authoring diagnostics

Explain every compromise #

renderWithReport() combines safe HTML with source-aware warnings, profile violations, and bounded target-loss reporting.

1Parser warnings
2Profile violations
1Render losses

Warnings

L3:C19 Undefined reference 'nowhere'

Profile decisions

heading Headings are disabled in comments to prevent disrupting page structure.
raw_block Raw HTML is disabled for security reasons.

Target losses

raw-format-dropped Dropped block raw format "latex" while rendering html
06

Source lines

Supported blocks in the main preview carry a data-source-line anchor for scroll synchronization.

07

Content cache

The configured renderer stores deterministic output by source, format, profile, options, extensions, and engine version.

Enabled through Tempest Cache with a one-hour expiration.

∞

Safe by default

Raw HTML is escaped in HTML and Markdown, omitted from plain text, and represented only as text in ANSI.