sercrod

*rem

Summary

*rem removes an element from the rendered output and treats it as a Sercrod-only comment. The directive has an alias n-rem.

Use *rem when you want to keep blocks of markup, notes, or alternate versions in your templates for Sercrod, while ensuring that nothing from those blocks appears in the final HTML that the browser or user sees.

Basic example

A debug-only block that you want to keep in the template, but never ship:

<serc-rod id="app" data='{"debug": true}'>
  <div *rem>
    This block is visible only to Sercrod and your editor,
    not to end users.
  </div>

  <p>Real content goes here.</p>
</serc-rod>

Behavior:

Behavior

Aliases:

Typical use cases

Common situations where *rem is useful:

Evaluation timing

Practical effect:

Execution model

Conceptually, the renderer behaves like this:

  1. Sercrod visits a node in the template.
  2. It checks whether the node has *rem or n-rem.
  3. If neither attribute is present:
    • Rendering proceeds normally, and other directives are considered.
  4. If *rem or n-rem is present:
    • Sercrod does not evaluate any directives on that node.
    • Sercrod does not descend into children.
    • The element is omitted from the rendered output.

The important points:

Variable creation and scope layering

*rem does not introduce new variables or scopes.

You can think of *rem as a rendering guard that operates before any scope-sensitive logic.

Parent access

Because *rem prevents the entire subtree from being rendered:

This is useful for:

Use with conditionals and loops

*rem is stronger than conditionals and loops on the same element:

Examples of patterns that do not make sense and should be avoided:

<div *if="debug" *rem>
  <!-- The *if is meaningless here; *rem wins. -->
  <p>Debug panel</p>
</div>

<li *for="item of items" *rem>
  <!-- The *for is also meaningless; the item is never rendered. -->
  <span *print="item.name"></span>
</li>

Recommended usage:

Best practices

Additional examples

Prototype section kept in the template:

<main>
  <section>
    <h1>Current layout</h1>
    <p>This is the layout users see.</p>
  </section>

  <section *rem>
    <h1>Future layout experiment</h1>
    <p>
      This section is only for designers and developers.
      It will not appear in the production DOM.
    </p>
  </section>
</main>

Inline TODO reminder:

<footer>
  <div *rem>
    TODO:
    - Add social media links
    - Confirm final copyright text
  </div>

  <small>&copy; Example Inc.</small>
</footer>

Notes