example - speced/respec GitHub Wiki
Marks a <pre>, <aside>, or other element as a numbered example. Adds an "Example N" heading with an optional title.
<pre class="example">
const result = navigator.credentials.get({ password: true });
</pre><aside class="example" title="Using the Fetch API">
<p>Here is how to make a request:</p>
<pre>
const res = await fetch("/data.json");
</pre>
</aside><pre class="illegal-example">
document.write("<!-- don't do this -->");
</pre>- Examples are numbered automatically ("Example 1", "Example 2", โฆ)
- A self-link (
ยง) is generated so readers can link directly to a specific example - The
titleattribute is interpreted as HTML โ seetitleattributes - Use
class="illegal-example"to mark a counter-example (renders with a different style) -
<aside class="example">can contain nested<pre>elements with mixed prose and code