*example
Summary
*example displays a Practical Knowledge example for one directive. *examples is an equivalent alias for readable plural wording.
Basic usage
<serc-rod>
<pre *example="'print'"></pre>
</serc-rod>
The expression resolves to one directive name. An array displays examples for each named directive independently:
<serc-rod>
<pre *examples="['if', 'print']"></pre>
</serc-rod>
This requests the if examples and the print examples as separate entries; it does not request a combined example.
Output
- On
<pre>, the example code is written totextContent. - On other elements, the example is sent to the browser console.
- The output follows the same console-versus-
<pre>convention as*log.
Source and compiled code
*example and *examples are source-side documentation helpers. They load Practical Knowledge data only in the interpreter/runtime documentation page. The Sercrod compiler removes the directives and does not embed the knowledge-base data or helper implementation in compiled JavaScript.
The generated examples are separate from adapter and compiler source. They describe practical usage; they do not grant runtime access to an adapter implementation.